How do I use OpenCover and ReportGenerator to view Unit Test Coverage Results?

后端 未结 4 838
温柔的废话
温柔的废话 2021-01-31 02:52

I\'m a noob to using both OpenCover and ReportGenerator and I\'m struggling a bit in understanding how to get them working. I\'m using VS.NET 2012 \'Professional\' which means I

4条回答
  •  执念已碎
    2021-01-31 03:27

    It is a hell to configure opencover for multiple test containers.

    Use this my smart Powershell script, it can give you some ideas.

    https://github.com/rpokrovskij/opencover4vs.ps1/blob/master/opencover4vs.ps1

    you need to configure two major things : how to find your test dlls and which namespaces to include to the output. I do it this way:

    $TestDllsPatterns = @(,'*\bin\Debug\Vse.*.Test.dll')  
    $TestableCodeNamespacePatterns = @(,'*') 
    

    Note, my tests starts from prefix Vse. You need the Debug\Prefix key to filter out core nUnit tests from folders like Debug\netcore1.1\Vse.

提交回复
热议问题