public void ExceptionHandlerIsNotCalledWhenExceptionDoesNotMatch_AlternateHandler() { ExceptionHandlerCalledClass fixture = new ExceptionHandlerCalledClass(); TestBuilder.RunTestCase(fixture, "ThrowsApplicationException_AlternateHandler"); Assert.IsFalse(fixture.HandlerCalled, "Base Handler should not be called"); Assert.IsFalse(fixture.AlternateHandlerCalled, "Alternate Handler should not be called"); }
public void TestIsNotRunnableWhenAlternateHandlerIsNotFound() { ExceptionHandlerCalledClass fixture = new ExceptionHandlerCalledClass(); Test test = TestBuilder.MakeTestCase( fixture, "MethodWithBadHandler" ); Assert.AreEqual( RunState.NotRunnable, test.RunState ); Assert.AreEqual( "The specified exception handler DeliberatelyMissingHandler was not found", test.Properties.Get(PropertyNames.SkipReason) ); }
public void ExceptionHandlerIsCalledWhenExceptionMatches() { ExceptionHandlerCalledClass fixture = new ExceptionHandlerCalledClass(); TestBuilder.RunTestCase( fixture, "ThrowsArgumentException" ); Assert.IsTrue(fixture.HandlerCalled, "Base Handler should be called"); Assert.IsFalse(fixture.AlternateHandlerCalled, "Alternate Handler should not be called"); }