Comment 1 for bug 465416

Revision history for this message
Charlie Poole (charlie.poole) wrote :

I converted this to a question because it seems like you may have misunderstood how to use TestCase. Of course, we can reinstate the bug if I misunderstood what you want.

If you make the argument to your test method an array, then NUnit will pass the array to it. OTOH, if you want NUnit to call your method multiple times with different arguments, you should use double as the arg type and either have multiple TestCase attributes(1) or use a ValuesAttribute on the parameter(2)

(1)
[TestCase(2)]
[TestCase(1)]
[TestCase(1.1)]
public void MyTest(double price) { ... }

(2)
public void MyTest(
   [Values(2,1,1.1)] double price ) { ... }