Closing brackets reported as not covered

Closing brackets reported as not covered

Quick question. I was wondering if something was fixed (changed?) in the new version of NCover. In the old version, a test method like this:

[Test] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void ContrivedTest() { SetTaskDate(DateTime.MinValue); //will throw error }

Will report that the last closing bracket is an unvisited line of code. I've got a bunch of these in my tests. I'm at 99.5% coverage and looking to get that last 0.5%. Does the current version of NCover exhibit this same behavior?

Regards- Eric


RE: Closing brackets reported as not covered

Yes, the current version of NCover exhibits that behaviour, because there is a compiler-generated return statement just before the end of the method which is never reached.

Regards, Stephen Ward.