Skip to content

unittest "test run" reports wrong test case count #494

Closed

Description

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

dotnet test

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions