Hi, I am new to Nunit and I am passing a series of objects to TestCase as a TestCaseSource. For some reason, although Nunit seems to run the test first without any parameters passed to it, which leads to ignored output:
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 of the child tests had TheCountsAreCorrect () errors, 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 do not want this test run to ever be, it does not make sense, and it removes the test result. I tried to ignore it, and it sets the test output correctly, but it returns when I run all the tests again.
Is there something that I donβt see, I searched everywhere.
source share