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);
        }
Esempio n. 2
0
 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));
        }
Esempio n. 4
0
 public ICommandResult Delete(DeleteCollegeCommand command)
 {
     return(_handler.Handle(command));
 }
Esempio n. 5
0
 public void Delete(DeleteCollegeCommand command)
 {
 }