public async Task SetupThrowingExecution(
            [Frozen(Matching.DirectBaseType)] ApplicationException expected,
            ErroredExecutionSetup sut,
            MethodData methodData)
        {
            // Act
            Func<Task> execute = ((IExecutionSetup) sut).Setup(methodData);

            // Executing method should not throw but return a faulted task.
            Task task = execute();

            // Assert
            Assert.True(task.IsFaulted);
            ApplicationException actual = await Assert.ThrowsAsync<ApplicationException>(() => task);
            Assert.Same(expected, actual);
        }
Example #2
0
        public async Task SetupThrowingExecution(
            [Frozen(Matching.DirectBaseType)] MyException expected,
            ErroredExecutionSetup sut,
            MethodData methodData)
        {
            // Act
            Func <Task> execute = ((IExecutionSetup)sut).Setup(methodData);

            // Executing method should not throw but return a faulted task.
            Task task = execute();

            // Assert
            Assert.True(task.IsFaulted);
            MyException actual = await Assert.ThrowsAsync <MyException>(() => task).ConfigureAwait(false);

            Assert.Same(expected, actual);
        }
 public void InitialiseException(
     [Frozen(Matching.DirectBaseType)] SystemException expected,
     ErroredExecutionSetup sut)
 {
     Assert.Same(expected, sut.Exception);
 }
Example #4
0
 public void InitialiseException(
     [Frozen(Matching.DirectBaseType)] MyException expected,
     ErroredExecutionSetup sut)
 {
     Assert.Same(expected, sut.Exception);
 }