Example #1
0
        public void ShouldReturnValidWhenDeleteCommandIsValid()
        {
            var command = new DeleteProfessorCommand();

            command.Id = Guid.NewGuid();
            var handler = new ProfessorHandler(new ProfessorRepositoryMock(), new EmailServiceMock());
            var result  = handler.Handle(command);

            Assert.AreEqual(true, result.Status);
        }
Example #2
0
        public void ShouldReturnValidWhenEditCommandIsValid()
        {
            var command = new EditProfessorCommand();

            command.Id        = Guid.NewGuid();
            command.FirstName = "FirstName";
            command.LastName  = "LastName";
            command.Document  = "402.020.980-44";
            command.Email     = "*****@*****.**";
            command.IdCourse  = Guid.NewGuid();
            var handler = new ProfessorHandler(new ProfessorRepositoryMock(), new EmailServiceMock());
            var result  = handler.Handle(command);

            Assert.AreEqual(true, result.Status);
        }
Example #3
0
        public void ShouldReturnInvalidWhenCreateCommandInvalid()
        {
            var result = _handler.Handle(_invalidCreateCommand);

            Assert.AreEqual(false, result.Status);
        }
 public ICommandResult Post([FromBody] CreateProfessorCommand command)
 {
     return(_handler.Handle(command));
 }