Skip to content

Coverlet is not considering the excludefromCoverage attribute at method level #809

Closed
@VenkateshSrini

Description

@VenkateshSrini

Hi,
I'm using the Coverlet to measure .NET core 3.1 Web API code coverage. I have used entity framework for creating by repository. There are some methods have anonymous object as return types and hence could not be unit tested. I want those methods to be alone excluded from coverage so I used [ExlcudeFromCodeCoverage] on those methods only. But Coverlet is not considering that at all and still generated the code coverage for the same. Please see the method EditTask in the TaskRepo class as an example in the attached code.
TaskApi.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtenet-coverageIssue related to possible incorrect coverage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions