Skip to content

ExcludeFromCodeCoverage skipped for some lines in excluded method #1072

Open
@kinder001

Description

@kinder001

Hello!
I use coverlet NuGet version 3.0.2

I have method marked as [ExcludeFromCodeCoverage], It's async method.
Some lines inside method skipped from excluding and are marked as uncovered, It's on PrintScreen from report below code

``
[ExcludeFromCodeCoverage]
public async Task<List> GetOrganizationStructureByPartnerAsync(Guid partnerId)
{
var topPartner = await _partnerService.GetTopPartnerAsync(partnerId);

        var filials = await GetFilialsByBusinessUnits().Where(i=>i.NewDicFilialExtensionBase.NewPartnerId == topPartner.Id)
                                                       .ToListAsync();

        var filialIds = filials.Select(i => i.NewDicFilialId).ToList();

        var businessUnits = await _db.BusinessUnitBase.Include(i => i.BusinessUnitExtensionBase)
                                                      .In(filialIds, i=> i.BusinessUnitExtensionBase.NewFilialid.Value)
                                                      .ToListAsync();

        return filials.Select(i => i.ToViewModel(businessUnits)).ToList();
    }

``

And printscreen from coverage report

Снимок экрана 2021-01-27 в 13 35 38

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproNeeds repro to be investigated, cannot repro in localquestionThis issue is a questionstaletenet-coverageIssue related to possible incorrect coveragewaiting for customerWaiting for customer action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions