Exemplo n.º 1
0
        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.");
        }
Exemplo n.º 2
0
        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.");
        }
Exemplo n.º 3
0
        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.");
        }
Exemplo n.º 4
0
        public void PendingTaskShouldPass()
        {
            Task task = TaskBuilder.Pending();

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

            act.ShouldNotThrow();
        }
Exemplo n.º 5
0
        public void ShouldAllowChainingWithWhich()
        {
            Task task = TaskBuilder.Pending();

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

            act.ShouldNotThrow();
        }
Exemplo n.º 6
0
        public void ShouldAllowChainingWithAnd()
        {
            Task task = TaskBuilder.Pending();

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

            act.ShouldNotThrow();
        }