示例#1
0
        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));
        }
示例#2
0
        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));
        }