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

Using statement in test breaks coverage #92

Closed
ghost opened this issue May 2, 2018 · 1 comment
Closed

Using statement in test breaks coverage #92

ghost opened this issue May 2, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented May 2, 2018

Using nunit 3.9.0 and MiniCover (btw really appreciate the work), I am seeing a weird situation where using statement appears to break coverage. Another slightly odd behavior I get is that the test source files are included in the coverage results.

With these tests:

[Test]
public void Test()
{
    var stream = new MemoryStream();
    stream.Dispose();
}

[Test]
public void TestUsing()
{
    using(var stream = new MemoryStream())
    {

    }
}

Report shows Test() lines are covered, but TestUsing() lines are not. Any tests that follow TestUsing() are also not covered, and the source code of classes only exercised by those tests are not covered.

Calling Dispose() directly does not seem to cause this result.

@lucaslorentz
Copy link
Owner

lucaslorentz commented Nov 21, 2019

This has been fixed since version v3.0.0-alpha-1.

Please try again on latest version v3.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant