public GetEmployerAgreementTestFixtures WithUser(long accountId, string firstName, string lastName, Role role, out User user) { var account = EmployerAgreementBuilder.GetAccount(accountId); EmployerAgreementBuilder.WithUser(account.Id, firstName, lastName, role, out user); return(this); }
public async Task Handle(string hashedAccountId, long agreementId, Guid externalUserId) { EmployerAgreementBuilder.EvaluateSignedAndPendingAgreementIdsForAllAccountLegalEntities(); EmployerAgreementBuilder.SetupMockDbContext(); var request = BuildRequest(hashedAccountId, agreementId, externalUserId); var handler = new GetEmployerAgreementQueryHandler( new Lazy <EmployerAccountsDbContext>(() => EmployerAgreementBuilder.EmployerAccountDbContext), EmployerAgreementBuilder.HashingService, Validator.Object, ConfigurationProvider); Response = await handler.Handle(request); }
public async Task Handle(long accountLegalEntityId) { EmployerAgreementBuilder.EvaluateSignedAndPendingAgreementIdsForAllAccountLegalEntities(); EmployerAgreementBuilder.SetupMockDbContext(); var request = BuildRequest(accountLegalEntityId); var handler = new GetLastSignedAgreementQueryHandler( new Lazy <EmployerAccountsDbContext>(() => EmployerAgreementBuilder.EmployerAccountDbContext), Mock.Of <IHashingService>(), Validator.Object, ConfigurationProvider); Response = await handler.Handle(request); }
public GetEmployerAgreementTestFixtures() { EmployerAgreementBuilder = new EmployerAgreementBuilder(); Validator = new Mock <IValidator <GetEmployerAgreementRequest> >(); ConfigurationProvider = new MapperConfiguration(c => { c.AddProfile <AccountMappings>(); c.AddProfile <AgreementMappings>(); c.AddProfile <EmploymentAgreementStatusMappings>(); c.AddProfile <LegalEntityMappings>(); }); Validator.Setup(x => x.ValidateAsync(It.IsAny <GetEmployerAgreementRequest>())) .ReturnsAsync(new ValidationResult()); }
public GetEmployerAgreementTestFixtures WithAgreement(long accountId, long legalEntityId, long accountLegalEntityId, int agreementVersion, EmployerAgreementStatus status, out EmployerAgreement employerAgreement) { EmployerAgreementBuilder.WithAgreement(accountId, legalEntityId, accountLegalEntityId, agreementVersion, status, out employerAgreement); return(this); }
public GetEmployerAgreementTestFixtures WithSignedAgreement(long accountId, long legalEntityId, long accountLegalEntityId, int agreementVersion, DateTime signedTime, out EmployerAgreement employerAgreement) { EmployerAgreementBuilder.WithSignedAgreement(accountId, legalEntityId, accountLegalEntityId, agreementVersion, signedTime, out employerAgreement); return(this); }
public GetEmployerAgreementTestFixtures WithAccount(long accountId, string hashedAccountId) { EmployerAgreementBuilder.WithAccount(accountId, hashedAccountId); return(this); }