public void PendingTaskShouldFailWithReasonFormatted() { Task task = TaskBuilder.Pending(); Action act = () => task.Should().BeCompletedSuccessfully("I said {0}", "so"); act.ShouldThrow <AssertFailedException>().WithMessage("Expected task to be completed successfully because I said so but was WaitingForActivation."); }
public void PendingTaskShouldFail() { Task task = TaskBuilder.Pending(); Action act = () => task.Should().BeCompletedSuccessfully(); act.ShouldThrow <AssertFailedException>().WithMessage("Expected task to be completed successfully but was WaitingForActivation."); }
public void PendingTaskShouldFailWithReason() { Task task = TaskBuilder.Pending(); Action act = () => task.Should().BeFaulted(because: "I said so"); act.ShouldThrow <AssertFailedException>().WithMessage("Expected task to be faulted because I said so but was WaitingForActivation."); }
public void PendingTaskShouldPass() { Task task = TaskBuilder.Pending(); Action act = () => task.Should().BePending(); act.ShouldNotThrow(); }
public void ShouldAllowChainingWithWhich() { Task task = TaskBuilder.Pending(); Action act = () => task.Should().BePending().Which.IsCompleted.Should().BeFalse(); act.ShouldNotThrow(); }
public void ShouldAllowChainingWithAnd() { Task task = TaskBuilder.Pending(); Action act = () => task.Should().BePending().And.BePending(); act.ShouldNotThrow(); }