How do I pass an Action into a TestCase

Viewed 1007

I have an NUnit test

[TestCase(...)]
public void test_name(Action onConfirm)
{
   ...
}

What I want to do is pass an Action into this test in the TestCase attribute, but no matter what I try keeps failing. I tried to put

() => SomeDummyMethodIDefined()

directly into the TestCase and that didn't work.

I created an Action

Action DummyAction = () => SomeDummyMethodIDefined();

and pass DummyAction into the TestCase and that didn't work.

Is there a way to do this?

1 Answers
Related