Home > database >  XUnit How To Exclude Tests From JetBrains dotCover
XUnit How To Exclude Tests From JetBrains dotCover

Time:08-26

I have a solution with multiple unit tests projects.

And for code coverage i am using JetBrains dotCover

enter image description here

So the goal here is to exclude the Migrations folder

I have added a runsettings file named .runsettings in the root of the test project

<Functions>
    <Exclude>
        <Function>^GF.Infrastructure\.Migrations\..*</Function>
    </Exclude>
</Functions>

however the Migrations namespace still appears in the coverage results, and i have to manually exclude it :

You can also add new runtime filters right from the Unit Test Coverage: open the context menu for a desired node and then select Exclude and Create Runtime Coverage Filter.

like this : enter image description here

Visual Studio

Go to ReSharper | Options | dotCover | Filtering and add an entry to Do not analyze code in: enter image description here

  • Related