public async Task SaveTaskList_Success()
        {
            var model = new Domain.Models.TaskList {
                Name = "TestTaskList"
            };
            var request = new SaveTaskListRequest(model);

            var handler = new SaveTaskListRequestHandler(_trackingContext, Mapper.Instance);
            var result  = await handler.Handle(request, default(CancellationToken));

            Assert.AreEqual(result, Unit.Value);
        }
        public async Task UpdateTaskList_Success()
        {
            var dataGenerationResult = _trackingContext.AddTestData <Domain.Entities.TaskList>(5);
            var selectedId           = dataGenerationResult.Item2[1];
            var updatedModel         = new Domain.Models.TaskList {
                Id = selectedId, Name = "NewTaskListName"
            };
            var request = new UpdateTaskListRequest(selectedId, updatedModel);

            var handler = new UpdateTaskListRequestHandler(_trackingContext, Mapper.Instance);
            var result  = await handler.Handle(request, default(CancellationToken));

            Assert.AreEqual(Unit.Value, result);
        }
        public async Task UpdateTaskList_Validation(int id, string taskListName, bool instantiateModel, bool isValid)
        {
            Domain.Models.TaskList model = null;
            if (instantiateModel)
            {
                model = new Domain.Models.TaskList {
                    Name = taskListName
                };
            }
            var request          = new UpdateTaskListRequest(id, model);
            var validator        = new UpdateTaskListValidator();
            var validationResult = await validator.ValidateAsync(request);

            Assert.AreEqual(isValid, validationResult.IsValid);
        }
 public async Task Update(int id, [FromBody] Domain.Models.TaskList model)
 {
     await _mediator.Send(new UpdateTaskListRequest(id, model));
 }
 public async Task Create([FromBody] Domain.Models.TaskList model)
 {
     await _mediator.Send(new SaveTaskListRequest(model));
 }