NUnit test runner does not properly break out tests using TestCaseSourceAttribute even though bug is marked as fixed.
RSRP-183263 discusses that tests using the TestCaseSourceAttribute are not broken into individual tests (the tests are marked as passed or failed as a group with no way to identify exactly which test failed or why). This was closed as a duplicate of RSRP-149085 (which actually refers to TestFixtureAttribute instead of the TestCaseSourceAttribute). Now the latter (referring to TestCaseFixtureAttribute) is closed as fixed in the EAP. But testing with today's EAP build (2114) this is emphatically not fixed for the TestCaseSourceAttribute.
One of these issues needs to be reopened until this is fixed.
Here is sample code demonstrating the issue:
[TestCaseSource("AdditionTestCases")] public int TestAddition(int i, int j) { return i + j; } public IEnumerable AdditionTestCases() { yield return new TestCaseData(1, 3).Returns(4).SetDescription("Should pass."); yield return new TestCaseData(1, 3).Returns(7).SetDescription("Should fail."); }
Please sign in to leave a comment.
Hello Lawrence,
Thank you for noticing this! I've reopened RSRP-183263 with highest priority
and we're going to look into this problem soon.
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Hi Andrey,
Have you found the solution to this issue yet?
What I found also is that when I use SetName() method of TestCaseData, the tests get ignored when I run the test case. Here's an example:
UPDATE: I just installed R# 6.0 and it seems that the problem I mentioned above is fixed too. However I noticed another problem. Test cases with TestCaseSourceAttribe have green checkmark icon, but at the top of tests in Unit Test Session window those test cases are counted as "ignored".