Closed bdurrani closed 7 months ago
I'm having the same issue
Thansk for reporting and thanks a lot for the repro 🙏. I just checked it and this will be fixed with PR https://github.com/coverlet-coverage/coverlet/pull/1542.
That was fast! thanks @daveMueller
Describe the bug Please share a clear and concise description of the problem.
To Reproduce I have the following class under Test
I used the following script to run the unit tests and generate the coverage reports
Expected behavior
The method
CreateLoggerDictionary()
should be excluded from test coverageActual behavior
The method is not excluded from coverage
Workaround
Rewrite the code using
foreach()
Configuration (please complete the following information): Please provide more information on your .NET configuration:
Additional context I've attached the project here Coverlet-Test.zip