Exemplo n.º 1
0
        public static void TaskExGenericFromExceptionIsFaulted()
        {
            var exception = new Exception();
            var task      = TaskExEx.FromException <bool>(exception);

            Assert.IsTrue(task.IsFaulted);
        }
Exemplo n.º 2
0
        public static void TaskExGenericFromExceptionRespectsException()
        {
            var exception = new Exception();
            var task      = TaskExEx.FromException <bool>(exception);

            // ReSharper disable once PossibleNullReferenceException
            Assert.AreEqual(exception, task.Exception.InnerException);
        }