Skip to content

Confusing switch case coverage #72

@cbroxton

Description

@cbroxton

Hi,

I've got an issue with some confusing coverage statistics being generated for switch cases. My tests have covered all branches including the default branch however AltCover is still considering there to be a missing branch until I test with null as the value. Here's a screenshot of what the coverage looks like...

screencapture

I've also created a simple reproduction of the issue in the following repository...

AltCoverSwitchCaseTest

Coverage was generated with the following command...

dotnet test /p:AltCover=true /p:AltCoverSingle=true /p:AltCoverCobertura="Cobertura.xml" /p:AltCoverAssemblyExcludeFilter="xunit|.Test"

Is this a bug? Or if not could you please help clear up why there is a missing branch? As far as I can tell in the case that the value is null it should use the default branch which is already covered?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions