Hi I am new to Nunit and I am passing a series of objects to a TestCase as a TestCaseSource. For some reason though Nunit seems to run the test first with no parameters passed to it which results in an ignored output:
The test:
private readonly object[] _nunitIsWeird =
{
new object[] {new List<string>{"one", "two", "three"}, 3},
new object[] {new List<string>{"one", "two"}, 2}
};
[TestCase, TestCaseSource("_nunitIsWeird")]
public void TheCountsAreCorrect(List<string> entries, int expectedCount)
{
Assert.AreEqual(expectedCount,Calculations.countThese(entries));
}
TheCountsAreCorrect (3 tests), Failed: One or more child tests had errors TheCountsAreCorrect(), Ignored: No arguments were provided TheCountsAreCorrect(System.Collections.Generic.List
1[System.String],2), Success TheCountsAreCorrect(System.Collections.Generic.List
1[System.String],3), Success
So the first test is ignored because there are no parameters, but I don't want this test run, ever, it makes no sense and it's mucking up my test output. I tried ignoring it and that sets the test output correctly but it comes back when I run all tests again.
Is there something I am missing, I have looked everywhere.