The statements raising exceptions, inside tests that fail, are counted for the average duration.
The time spend when raising exceptions should be ignored.
Thanks for posting. Could you share your thoughts about how such a change would be useful to you? Sometimes exceptions are actually raised as normal behaviour in programs and it would be useful to be able to establish the performance penalty for this.
Maybe i was not very detailed and clear in my explanation (english is second language).
I have test method Test1.
The test failed in NCrunch at statement Stmt1.
I think it is not relevant for the average time to count the time spent in the failing test. My goal is to have only working tests.
If i want to test the exception raised i would guard them using exception asserts:
Assert.ThrowException<EXX>( code xxx ). the test would not fail, and the average running time calculated for passing tests will be relevant also for the scenarios where the code throws.
Am I correct in my understanding that you want to disregard any performance metrics that are derived from a failed test? I guess the only way I could see this working is if NCrunch were to separate the performance information from the code coverage ... this could be quite confusing if you were hovering the cursor over a black marker and NCrunch was telling you that the marker had an execution time, but no tests that covered it..