Esempio n. 1
0
        public void ShouldDeleteStudentWithSuccess()
        {
            commandDelete = new StudentInputDelete()
            {
                StudentId = student.Id
            };
            StandardResult result    = (StandardResult)handler.Handle(commandDelete);
            var            studentDB = _SREP.Get(student.Id);

            Assert.AreEqual(studentDB, null);
        }
Esempio n. 2
0
        public ICommandResult Handle(StudentInputDelete command)
        {
            _SREP.Delete(command.StudentId);
            var result = new StandardResult();

            if (_SREP.Get(command.StudentId) != null)
            {
                result.Notifications.Add("Error", "Não foi possivel deletar Discente!");
            }
            else
            {
                result.Notifications.Add("Success", "Discente Deletado");
            }

            return(result);
        }