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