-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unittest "test run" reports wrong test case count #494
Comments
Also happening when marked the unit test function with
Checking to see if I can figured out what's going on to provide a fix for this. |
@parrainc : In case of data-driven tests, there is a parent result for all the aggregated test results. Currently, this parent result is also counted as test and hence a mismatch. So it would be better if we could clearly display that there are 'x tests and x+n test results' in our output. |
Totally agree @jayaranigarg . It's way better if in the output it says what you point out instead of the actual count. |
@jayaranigarg did a change in UpdateResultsWithParentInfo method, removing the line 423, so the parent result is not added anymore in the results list. Even though this broke some of the tests, it's now behaving as it should in the example provided:
Also, planning to add a property to the TestResult (something like My question is, where should I send those values in order to display them in the CLI output (kind of lost here)? |
@parrainc : We will come back with an update on this. Making this change has other implications on our system and we will have to investigate that. Thank you for your patience. |
This change is needed to ensure that the data driven tests work fine in different CI scenarios like distribution and rerun and is intentional. |
Steps to reproduce
Write a unittest function with one test case data input
[DataTestMethod]
[DataRow(1)]
public void YouTest(int value)
{...}
When you run the test using
the output will be:
...
Starting test execution, please wait...
Total tests: 2. Passed: 2. Failed: 0. Skipped: 0. Test Run Successful.
Expected behavior
Actually it's only one test here, [DataTestMethod] is not a test.
Actual behavior
2 tests passed
Environment
MSTest 1.3.2
Note- This happened after we added support for hierarchical results #417
Fix - It would perhaps be best to say both in the CLI output - x tests and x+n test results.
The text was updated successfully, but these errors were encountered: