TestCase with DataRow attribute with null parameter ignored
See original GitHub issueDescription
When using MSTest.TestAdapter version 2.2.4 or higher, DataRow testcases with a null parameter are not discovered or executed. When using 2.2.3, all 3 testcases are discovered.
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow(" ")]
public void TestMethod(string parameter)
{
}
Steps to reproduce
Create a test project targetting .NET5 or .NET6, and make sure the version of the package MSTest.TestAdapter is 2.2.4 or higher. Add test method as seen above
Expected behavior
3 testcases should have been executed, but only the last two are executed
Actual behavior
Only the testcases with “” and " " as paramter are executed
Environment
MSTest.TestAdapter 2.2.4 or higher
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
MsTest datadriven: ignore specific datarows via testattribute?
How to not let the ignored tests "pass" in the MSTEST testrunner (and in the CI via msbuild), or even better, do not...
Read more >MsTest v2 DataRowAttribute: null is ignored if last of two ...
Hi, I found a mismatch in the execution of DataRow tests between MsTestRunner and NCrunch. In detail it seems like NCrunch simply ignores...
Read more >How to test for a not null value for a object property
I'm trying to figure out what the assertion should look like because I want to test to see that the title that was...
Read more >Java Unit Testing with JUnit and TestNG
A test case contains a number of tests, marked with annotation of " @org.junit.Test ". Each of the test is run independently from...
Read more >Most Complete MSTest Framework Tutorial Using .Net Core
Marks a method, i.e., an actual test case in the test class. [DataRow], Allows setting the values of the parameters of the test....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Haplois, surely that is a temporary workaround, not a solution? So why close this issue?
Even though you have changed the implementation of how discovery of tests are done, shouldn’t the new one also be fixed to return the expected amount of testcases? Instead of saying - run the old behavior if you want something that works!!! Because I can’t see, nor has anyone else pointed it out, anything wrong with the sample provided by the TS - so it should work even with new discovery method.
Sounds like a duplicate of #1016, where test cases get ignored when they have the same display name.