Skip to content
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

Assert.Multiple produces new tests in the report if inner assertions fail #630

Closed
nvborisenko opened this issue Jul 2, 2019 · 4 comments · Fixed by #631
Closed

Assert.Multiple produces new tests in the report if inner assertions fail #630

nvborisenko opened this issue Jul 2, 2019 · 4 comments · Fixed by #631

Comments

@nvborisenko
Copy link
Contributor

  • NUnit 3.12, NUnit3TestAdapter 3.13
  • Visual Studio 2019 (16.1.1)
[Test]
        public void Test1()
        {
            Assert.Multiple(() =>
            {
                Assert.AreEqual(2, 3, "Real part");
                Assert.AreEqual(4, 5, "Imaginary part");
            });
        }

When we execute this test we gets 2 test results instead one.
image

NUnit3TestAdapter lies about tests count.

@OsirisTerje
Copy link
Member

Not sure what you mean here. The Assert.Multiple works this way, it continues with the other asserts, so that you see all the results.

@OsirisTerje OsirisTerje added the confirm We need a separate confirmation of this issue label Jul 9, 2019
@nvborisenko
Copy link
Contributor Author

Right. But my project contains only 1 test. When I executed test, I got 2 tests... It is confusing. And 2 tests fail, but I have only 1...

@OsirisTerje
Copy link
Member

Ahh, got it.

@OsirisTerje
Copy link
Member

Just to be precise:
Visual Studio Test Explorer itself reports this correctly.
It is the command line vstest.console that reports this wrongly. That counter is from vstest.console, and not from the adapter.
The error also comes only when both tests are failing, if both are passing or just one is passing it reports correctly.

@OsirisTerje OsirisTerje added is:bug and removed confirm We need a separate confirmation of this issue labels Jul 9, 2019
@OsirisTerje OsirisTerje added this to the 3.14 milestone Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants