public void ShouldReturnValidWhenDeleteCommandValid() { var command = new DeleteCollegeCommand(); command.Id = Guid.NewGuid(); var handler = new CollegeHandler(new CollegeRepositoryMock(), new EmailServiceMock()); var result = handler.Handle(command); Assert.AreEqual(true, result.Status); }
public void Delete(DeleteCollegeCommand command) { _db.Connection().Execute( "spDeleteCollege", new { id = command.Id }, commandType: CommandType.StoredProcedure ); }
public ICommandResult Handle(DeleteCollegeCommand command) { string id = command.Id.ToString(); if (string.IsNullOrEmpty(id)) { AddNotification("Id", "Identificador inválido"); } if (Invalid) { return(new CommandResult(false, "Erro ao deletar faculdade", Notifications)); } _repository.Delete(command); return(new CommandResult(true, "Faculdade deletada com sucesso", null)); }
public ICommandResult Delete(DeleteCollegeCommand command) { return(_handler.Handle(command)); }
public void Delete(DeleteCollegeCommand command) { }