FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
527 stars 40 forks source link

IF condition is marked with green color even when it's covered partially #194

Closed smigielns closed 2 years ago

smigielns commented 3 years ago

Installed product versions

Description

if condition is marked with green color even when it's covered partially only. The problem occurs only when the condition is always true. When the condition is always false then it's marked with orange color.

Steps to recreate

Test code

[TestCase(true, 1)]
public void IF_checker(bool condition, int expected)
{
    var result = _mapper.Test(condition);

    result.Should().Be(expected);
}

Implementation

public int Test(bool condition)
{
    var result = 0;
    if (condition)
    {
        result = 1;
    }
    return result;
}

Current behavior

obraz

Expected behavior

The line that contains if statement should be marked with orange color.

tonyhallett commented 3 years ago

Related to https://github.com/coverlet-coverage/coverlet/issues/1028 ?

tonyhallett commented 2 years ago

Is this a .Net Framework project ?

smigielns commented 2 years ago

It is a .NET Core 3.1 project.

tonyhallett commented 2 years ago

Then this is coverlet behaviour I have created an issue for. Perhaps you can add to that issue.