Esempio n. 1
0
        public void TestAwaitExceptionThrown()
        {
            var thrower = new ExceptionThrower();

            // the exception is thrown when we await
            Assert.ThrowsAsync <AwaitException>(async() => await thrower.DelayAndThrow(5));

            // make sure the method was called ok
            Assert.True(thrower.AwaitCompleted);
        }