Closed arseni-mourzenko closed 1 year ago
Thanks for reporting this.
Seeing similar behavior where a Generic Class has a method that returns an IAsyncEnumerable
, the method is marked with ExcludeFromCodeCoverage
however coverage is reported as zero instead of being ignored.
@RobARichardson I created another issue for that (#1431). I think it is another bug and my PR will not fix this.
@MarcoRossignoli, do you know when the new version of Coverlet would be available through NuGet?
Hi.
Using coverlet.msbuild.3.1.2, I noticed an issue with code coverage for a method which returns
IAsyncEnumerable
, as soon as the method is inside a generic class.Here's a short example which reproduces the issue:
Given the following tests:
the coverage report will show that the
Demo
method inside the classA
has 100% branch coverage, whereas the methodDemo
insideA<T>
has only partial coverage (one branch out of two) on the line{
, as well as on the following twoyield return
lines.The code of the two methods and the corresponding tests being identical, the coverage should instead be identical, that is, 100% in both cases.