예제 #1
0
        public void ShouldDeleteProfessorWithSuccess()
        {
            commandDelete = new ProfessorInputDelete()
            {
                ProfessorId = professor.Id
            };
            StandardResult result      = (StandardResult)handler.Handle(commandDelete);
            var            professorDB = _PREP.Get(professor.Id);

            Assert.IsFalse(professorDB.Active);
        }
예제 #2
0
        public ICommandResult Handle(ProfessorInputDelete command)
        {
            _PREP.Disable(command.ProfessorId);
            var result = new StandardResult();

            if (_PREP.Get(command.ProfessorId).Active != false)
            {
                result.Notifications.Add("Error", "Não foi possivel deletar Docente!");
            }
            else
            {
                result.Notifications.Add("Success", "Professor Deletado");
            }

            return(result);
        }