Beispiel #1
0
        public void InvokeTask_ShouldHaveMultipleInvocations()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            subject.UpdateInvocation(() => { }, () => throw new Exception("Second Invocation"));

            // Act
            Func <Task> actual = async() => await subject.InvokeTask();

            Func <Task> thrower = async() => await subject.InvokeTask();

            // Assert
            actual.Should().NotThrow();
            thrower.Should().ThrowExactly <Exception>().WithMessage("Second Invocation");
        }
Beispiel #2
0
        public void InvokeTask_ShouldThrowExceptionWithMethodNameIfInvocationNotUpdated()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            // Act
            Func <Task> actual = async() => await subject.InvokeTask();

            // Assert
            actual.Should().ThrowExactly <TestException>().WithMessage("If you want to use methodName, configure via Builder.");
        }
Beispiel #3
0
        public void InvokeTask_ShouldNotThrowExceptionIfInvocationUpdated()
        {
            // Arrange
            MockMethod subject = new MockMethod("methodName");

            subject.UpdateInvocation();

            // Act
            Func <Task> actual = async() => await subject.InvokeTask();

            // Assert
            actual.Should().NotThrow();
        }
 public Task ResponseTaskVoid() => _responseTaskVoid.InvokeTask();
 public Task Wait() => _wait.InvokeTask();