public void return_error_when_title_is_null()
        {
            var args = new TodoUpdatingArgs(id: 1, title: null, description: "a description");

            var result = service.Update(args);

            result.IsOk.ShouldBeFalse();
            result.Errors.First().FieldId.ShouldBe(nameof(args.Title));
            result.Errors.First().ErrorCode.ShouldBe(ErrorCodes.Required);
        }
Exemple #2
0
        private ServiceExecutionResult UpdateTodo(TodoUpdatingRequest todoUpdatingRequest)
        {
            var args = new TodoUpdatingArgs(
                todoUpdatingRequest.Id,
                todoUpdatingRequest.Title,
                todoUpdatingRequest.Description);

            return(updateTodoService.Update(args));
        }