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.");
        }
Example #2
0
        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.");
        }
Example #3
0
        public void PendingTaskShouldPass()
        {
            Task <bool> task = TaskResultBuilder.Pending();

            Action act = () => task.Should().BePending();

            act.ShouldNotThrow();
        }
Example #4
0
        public void ShouldAllowChainingWithWhich()
        {
            Task <bool> task = TaskResultBuilder.Pending();

            Action act = () => task.Should().BePending().Which.IsCompleted.Should().BeFalse();

            act.ShouldNotThrow();
        }
Example #5
0
        public void ShouldAllowChainingWithAnd()
        {
            Task <bool> task = TaskResultBuilder.Pending();

            Action act = () => task.Should().BePending().And.BePending();

            act.ShouldNotThrow();
        }
Example #6
0
 public static Task Pending()
 {
     return(TaskResultBuilder.Pending());
 }