Example #1
0
        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);
        }
Example #2
0
 public void Delete(DeleteClassRoomCommand command)
 {
     _db.Connection().Execute(
         "spDeleteClassRoom",
         new
     {
         id = command.Id
     },
         commandType: CommandType.StoredProcedure
         );
 }
Example #3
0
        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));
        }
Example #4
0
 public ICommandResult Delete(DeleteClassRoomCommand command)
 {
     return(_handler.Handle(command));
 }
 public void Delete(DeleteClassRoomCommand command)
 {
 }