Exemplo n.º 1
0
        public void ShouldValidateWhenInCompleteStatus()
        {
            // Arrange

            var validator = new DeleteTodoTaskValidator();

            // Act & Assert

            validator.ValidateAndThrow(
                new TodoTaskEntity
            {
                Id       = "afab15bc-d16b-49b8-a072-6bc1bc0d5156",
                Name     = "Make a toast",
                Priority = 1,
                Status   = TodoTaskEntityStatus.Completed
            });
        }
Exemplo n.º 2
0
        public async Task ShouldInvalidateWhenNotInCompleteStatus()
        {
            // Arrange

            var validator = new DeleteTodoTaskValidator();

            // Act & Assert

            await Assert.ThrowsAsync <TodoListValidationException>(() =>
                                                                   validator.ValidateAndThrow(
                                                                       new TodoTaskEntity
            {
                Id       = "afab15bc-d16b-49b8-a072-6bc1bc0d5156",
                Name     = "Make a toast",
                Priority = 1,
                Status   = TodoTaskEntityStatus.InProgress
            }));
        }