This test class demonstrates the problem, where exceptions that occur during TestCleanup are ignored by unit tests decorated with the ExpectedException attribute:
[TestClass]
public class TheTestClass
{
[TestCleanup]
public void ExceptionsOccurringDuringCleanupAreIgnoredOnTestsMarkedWithExpectedExceptionAttribute()
{
Assert.Fail();
}
[ExpectedException(typeof(Exception))]
[TestMethod]
public void ThisTestPassesWithNCrunch()
{
throw new Exception();
}
[TestMethod]
public void ThisTestFailsWithNCrunch(){ }
}
Is this an NCrunch bug? If so, will it be corrected?