I have a method defined like this
public void test(string fileName, int totalObjects, params int[] objectsToTest)
I am trying to use it in my NUnit test class like this
[TestCase("test.doc", 1, 3)]
public void test(string fileName, int totalObjects, params int[] objectsToTest)
the code compiles just fine but when NUnit test runner tries to perform the test I get the following exception:
System.ArgumentException : Object of type 'System.Int32' cannot be converted to type 'System.Int32[]'.
How can I get rid of the error and keep the ability to use the TestCase
syntax test for method parameters?
EDIT:
I know I can pass an array (and I don't need to declare last parameter with params keyword for this). I am trying to avoid explicit passing of the array.