public void CanceledTaskShouldPass() { Task <bool> task = TaskResultBuilder.Canceled(); Action act = () => task.Should().BeCompleted(); act.ShouldNotThrow(); }
public void CanceledTaskShouldFail() { Task <bool> task = TaskResultBuilder.Canceled(); Action act = () => task.Should().BeCompletedSuccessfully(); act.ShouldThrow <AssertFailedException>().WithMessage("Expected task to be completed successfully but was Canceled."); }
public void CanceledTaskShouldFail() { Task <bool> task = TaskResultBuilder.Canceled(); Action act = () => task.Should().BeFaulted(); act.ShouldThrow <AssertFailedException>().WithMessage("Expected task to be faulted but was Canceled."); }
public void ShouldAllowChainingWithWhich() { Task <bool> task = TaskResultBuilder.Canceled(); Action act = () => task.Should().BeCanceled().Which.IsCanceled.Should().BeTrue(); act.ShouldNotThrow(); }
public void ShouldAllowChainingWithAnd() { Task <bool> task = TaskResultBuilder.Canceled(); Action act = () => task.Should().BeCanceled().And.BeCanceled(); act.ShouldNotThrow(); }
public static Task Canceled() { return(TaskResultBuilder.Canceled()); }