I have an ASP.NET project and I'm using ReSharper to do my unit testing along with dotCover. I'm looking for a way to mark a method as not needing to be tested. I For example, I have some simple one-liner methods that send work elsewhere and return the result. The methods that do the actual work are covered by unit tests, but these "intermediate" methods don't need to be.
These methods will show as uncovered by ReSharper. I'd like to be able to flag them so they don't show as covered or uncovered. This would let me explicitly state when I have code that, for whatever reason, will be excluded from my unit tests and does not need to be concerned about being covered.
Thanks to Alexei Levenkov, a similar question with a great answer has already been asked. In short, ASP.NET now has an [ExcludeFromCodeCoverage] attribute that can be added to a class or a method. Once ReSharper re-analyzed my code coverage, it no longer shows these methods as uncovered.
https://stackoverflow.com/a/1603193/529554
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With