Closed ViktorPlacek closed 2 months ago
I don't think it is fair to evaluate code called from fixture as tested
FCC does not state that code is tested. FCC reports code coverage.
If you do not want code to be included then exclude it.
The exclusion does not work as I would expect. When I decorate a caller class by [ExcludeFromCodeCoverage] it is correctly not showing any 'touch' result, but all called methods from any method of the excluded class are touched.
FCC just uses the code coverage of a provider when supplying the report and the editor marks.
Microsoft code coverage has the behaviour you mention whereas Coverlet has the behaviour that you expect. Coverlet is used for SDK style projects and OpenCover for the older project style. I do not know the behaviour of OpenCover.
So you can have the option RunMsCodeCoverage as No ( if your test project is SDK style ) or apply further attributes or use one of the other regexes to exclude the invoked code. You can also open an issue but note that FCC is using version 17.9.0 and not the current version 17.11.0.
Installed product versions
Description
Before running integration tests a Fixture is used for preparing environment for running tests ([Fact]). All code from Core project called by the fixture code is evaluated (colored) as touched. I don't think it is fair to evaluate code called from fixture as tested.
Steps to recreate
Current behavior
The code touched by a test fixture should not be treated as tested.
Expected behavior
Only the code called from [Fact] decorated method should be treated as tested.
Side note
Please, feel free to ask me for a simple example if the description is not clear enough.