public void ShouldReturnValidWhenDeleteCommandIsValid() { var command = new DeleteClassRoomCommand(); command.Id = Guid.NewGuid(); var handler = new ClassRoomHandler(new ClassRoomRepositoryMock()); var result = handler.Handle(command); Assert.AreEqual(true, result.Status); }
public void Delete(DeleteClassRoomCommand command) { _db.Connection().Execute( "spDeleteClassRoom", new { id = command.Id }, commandType: CommandType.StoredProcedure ); }
public ICommandResult Handle(DeleteClassRoomCommand command) { string id = command.Id.ToString(); if (string.IsNullOrEmpty(id)) { AddNotification("Id", "Identificador inválido"); } if (Invalid) { return(new CommandResult(false, "Erro ao deletar sala", Notifications)); } _repository.Delete(command); return(new CommandResult(true, "Sala deletada com sucesso", null)); }
public ICommandResult Delete(DeleteClassRoomCommand command) { return(_handler.Handle(command)); }
public void Delete(DeleteClassRoomCommand command) { }