示例#1
0
        private static void TestExceptions()
        {
            AsyncThrower.HandleSthExceptional().Wait();
            Console.WriteLine("First exception handled!");

            AsyncThrower.HandleSthExceptionalInTheVoid();
            Console.WriteLine("Second exception handled!");
        }
示例#2
0
        public void TestAsyncException()
        {
            AsyncThrower thrower = null;

            AddStep("add thrower", () => Child = thrower = new AsyncThrower(typeof(Exception)));
            AddUntilStep("wait for exception", () => thrower.ThrownException != null);

            assertCorrectStack(() => thrower.ThrownException);
        }
示例#3
0
        public async Task <ActionResult> ShowExceptionThrown()
        {
            await AsyncThrower.DoSthExceptional();

            return(Content("This is never sent"));
        }
示例#4
0
 public async Task <ActionResult> ShowExceptionSwallowed()
 {
     AsyncThrower.DoSthExceptionalInTheVoid();
     return(Content("This is actually sent"));
 }