microsoft / codecoverage

MIT License
79 stars 11 forks source link

Inherited records showing lack of code coverage (issue is applicable only for C# records with inheritance, and not for Classes) #92

Closed anandthirumala closed 7 months ago

anandthirumala commented 8 months ago

Code Coverage is indicating that the initial line of the object is lacking coverage, despite our comprehensive suite of tests designed to cover this record. This issue extends to all inherited records, even though we have diligently crafted tests to address them.

We seek clarification on whether this concern might be attributed to a limitation in the current release, or if there exists an alternative approach to effectively cover these records. If this is a known issue, then is there a fix in the pipeline.

public record ResultDto( StatusType Status, int OrderId, DateTime CreatedDate, int ResponseId, int RequestId, string ReferenceNo, decimal Amount ) : BaseResultDto( ResponseId, RequestId, OrderId, ReferenceNo, Amount, Status );

Your guidance on this matter would be greatly appreciated. Thank you.

jakubch1 commented 8 months ago

@anandthirumala could you please provide some sample project showing this issue? You can also try this: https://developercommunity.visualstudio.com/t/Code-coverage-reports-not-covered-setter/10089780#T-N10498682

jakubch1 commented 7 months ago

@anandthirumala closing this bug. Please reopen and provide example so we can continue investigation.