public void ValideSalarioContratual(double salarioContratual, bool valido) { var colaborador = new AdmissaoColaboradorCommand("Codeizi", "Treinamento", DateTime.Now, salarioContratual, DateTime.Now.AddYears(-50)); colaborador.IsValid(); Assert.Equal(valido, colaborador.ValidationResult.IsValid); }
public void ValideDataAdmisaoColaboradorTest(DateTime dataAdmissao, bool valido) { var colaborador = new AdmissaoColaboradorCommand("Codeizi", "Treinamento", dataAdmissao, 1000, DateTime.Now.AddYears(-50)); colaborador.IsValid(); Assert.Equal(valido, colaborador.ValidationResult.IsValid); }
public void ValideSobrenomeTest(string sobrenome, bool valido) { var colaborador = new AdmissaoColaboradorCommand("Codeizi", sobrenome, DateTime.Now, 1000, DateTime.Now.AddYears(-50)); colaborador.IsValid(); Assert.Equal(valido, colaborador.ValidationResult.IsValid); }
public void ValideDataAdmisaoDepoisDataNascimentoTest() { var colaborador = new AdmissaoColaboradorCommand("Codeizi", "Treinamento", DateTime.Now, 1000, DateTime.Now.AddYears(50)) { ObservacaoContratual = "Obs", }; colaborador.IsValid(); Assert.False(colaborador.ValidationResult.IsValid); }
public void ValideObservacaoContratual(string observacaoContratual, bool valido) { var colaborador = new AdmissaoColaboradorCommand("Codeizi", "Treinamento", DateTime.Now, 10, DateTime.Now.AddYears(-50)) { ObservacaoContratual = observacaoContratual, }; colaborador.IsValid(); Assert.Equal(valido, colaborador.ValidationResult.IsValid); }
public async Task AdmissaoDadosColoboradorInconsistente() { var mockColaboradorRepository = Substitute.For <IColaboradorRepository>(); await mockColaboradorRepository.RealizeAdmissao(Arg.Any <Colaborador>()); var mockUOW = Substitute.For <IUnitOfWork>(); mockUOW.Commit().Returns(true); var mockBus = Substitute.For <IMediatorHandler>(); var mockNotificationHandler = Substitute.For <INotificationHandler <DomainNotification>, DomainNotificationHandler>(); var admissaoColaborador = new AdmissaoColaboradorCommand(string.Empty, "Silva", new DateTime(2020, 1, 2), 10000, DateTime.Now.AddYears(-50)); var commandAdmissao = new ColaboradorCommandHandler(mockColaboradorRepository, mockUOW, mockBus, mockNotificationHandler); var result = await commandAdmissao.Handle(admissaoColaborador, CancellationToken.None); Assert.False(result); }