예제 #1
0
        public void CanceledTaskShouldFail()
        {
            Task task = TaskBuilder.Canceled();

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

            act.ShouldThrow <AssertFailedException>().WithMessage("Expected task to be completed successfully but was Canceled.");
        }
예제 #2
0
        public void CanceledTaskShouldPass()
        {
            Task task = TaskBuilder.Canceled();

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

            act.ShouldNotThrow();
        }
예제 #3
0
        public void ShouldAllowChainingWithAnd()
        {
            Task task = TaskBuilder.Canceled();

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

            act.ShouldNotThrow();
        }
예제 #4
0
        public void ShouldAllowChainingWithWhich()
        {
            Task task = TaskBuilder.Canceled();

            Action act = () => task.Should().BeCanceled().Which.IsCanceled.Should().BeTrue();

            act.ShouldNotThrow();
        }
예제 #5
0
        public void CanceledTaskShouldFail()
        {
            Task task = TaskBuilder.Canceled();

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

            act.ShouldThrow <AssertFailedException>().WithMessage("Expected task to be faulted but was Canceled.");
        }