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"); }
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."); }
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();