This project is read-only.

Global ExcludeFromCodeCoverage switch

Sep 18, 2014 at 8:11 AM

I would like to replace my current views with precompiled ones using this package. I like that I can do so by mostly changing the .csproj file.

However, I would like to not have this impact my solution too much, so I want to remove all the newly generated code from the coverage calculation (since views aren't unit tested right now either).

I have found that I can put a directive at the top of each view to accomplish this, but I was wondering if there is a global switch I can set somewhere to exclude all of the code generated by Razor Generator. If this is not currently an option, would you perhaps be willing to consider it in a future version?

Thanks for your consideration,
Olaf Keijsers
Sep 18, 2014 at 2:28 PM
There's a directive for it. Add a file at the root of your views directory named razorgenerator.directives with the content ExcludeFromCodeCoverage: true and it would add this attribute on generated views
Sep 18, 2014 at 2:58 PM
Thank you, that worked!