I have some test methods of the form:
[ExpectedException(typeof(MyException))]
public void Method() {
SUT.DoSomethingThatRaisesMyException();
}
in my test project. However when I turn on code coverage I have noticed that I am getting less than 100% coverage on the unit test project. This seems to be because the code coverage tool never sees the closing brace of Method() - it always exceptions before it gets there.
I can add the [ExcludeFromCodeCoverage] attribute to every test method, but that seems too clunky. Is there a way of excluding entire projects? Or is there a way of automatically excluding every test project.