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); }
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); }
public ProfessorHandlerTests() { _validCreateCommand = new CreateProfessorCommand(); _validCreateCommand.FirstName = "FirstName"; _validCreateCommand.LastName = "LastName"; _validCreateCommand.Document = "402.020.980-44"; _validCreateCommand.Email = "*****@*****.**"; _validCreateCommand.IdCourse = Guid.NewGuid(); _validCreateCommand.Phone = "0000000000000"; _invalidCreateCommand = new CreateProfessorCommand(); _invalidCreateCommand.FirstName = ""; _invalidCreateCommand.LastName = ""; _invalidCreateCommand.Document = "402.020.-44"; _invalidCreateCommand.Email = "example.com"; _invalidCreateCommand.IdCourse = Guid.NewGuid(); _invalidCreateCommand.Phone = ""; _handler = new ProfessorHandler(new ProfessorRepositoryMock(), new EmailServiceMock()); }
public ProfessorsController(IProfessorRepository repository, IEmailService emailService) { _repository = repository; _emailService = emailService; _handler = new ProfessorHandler(_repository, _emailService); }