Exemple #1
0
        public void GetThrowsException()
        {
            try
            {
                _controller.GetThrowsException();
            }
            catch (AggregateException ex)
            {
                Assert.Contains(typeof(DivideByZeroException), ex.InnerExceptions.Select(x => x.GetType()));
                return;
            }

            throw new InvalidOperationException("Should have thrown AggregateException");
        }
Exemple #2
0
        public void GetThrowsException()
        {
            try
            {
                _controller.GetThrowsException();
            }
            catch (ControllerProxyException e)
            {
                Assert.AreEqual(HttpStatusCode.InternalServerError, e.StatusCode);
                return;
            }

            Assert.Fail("Didn't throw exception");
        }