public void ThrowInfrastructureException_DoesNotGetWrappedInHttpException() { var expectedException = new WxeUserCancelException(); var handler = new ThrowingPage(expectedException); var actualException = Assert.Throws <WxeUserCancelException> (() => handler.ProcessRequest(CurrentHttpContext)); Assert.That(actualException, Is.SameAs(expectedException)); }
public void ThrowAnyException_WrappedsInHttpUnhandledException() { var expectedException = new ApplicationException(); var handler = new ThrowingPage(expectedException); var httpException = Assert.Throws <HttpUnhandledException> (() => handler.ProcessRequest(CurrentHttpContext)); Assert.That(httpException.InnerException, Is.SameAs(expectedException)); Assert.That(httpException.GetHttpCode(), Is.EqualTo(500)); }