Example #1
0
        public EmployerAccountsApiClientTestsFixture()
        {
            CancellationToken         = CancellationToken.None;
            MockSecureHttpClient      = new Mock <ISecureHttpClient>();
            MockApiMediator           = new Mock <IReadStoreMediator>();
            EmployerAccountsApiClient = new EmployerAccountsApiClient(MockSecureHttpClient.Object, MockApiMediator.Object);

            IsUserInRoleRequest = new IsUserInRoleRequest
            {
                AccountId = 112,
                UserRef   = Guid.NewGuid(),
                Roles     = new HashSet <UserRole> {
                    UserRole.Owner, UserRole.Transactor
                }
            };

            MockApiMediator
            .Setup(m => m.Send(It.IsAny <IsUserInRoleQuery>(), CancellationToken))
            .ReturnsAsync(true);

            IsUserInAnyRoleRequest = new IsUserInAnyRoleRequest
            {
                AccountId = 112,
                UserRef   = Guid.NewGuid()
            };

            MockApiMediator
            .Setup(m => m.Send(It.IsAny <IsUserInAnyRoleQuery>(), CancellationToken))
            .ReturnsAsync(true);
        }
Example #2
0
 public EmployerAccountsApiHealthCheck(IEmployerAccountsApiClient employerAccountsApiClient)
 {
     _employerAccountsApiClient = employerAccountsApiClient;
 }
 public UserService(IEmployerAccountsApiClient <EmployerAccountsConfiguration> employerAccountsApiClient)
 {
     _employerAccountsApiClient = employerAccountsApiClient;
 }
 public RunHealthCheckCommandHandler(Lazy <EmployerAccountsDbContext> db, IEmployerAccountsApiClient employerAccountsApiClient)
 {
     _db = db;
     _employerAccountsApiClient = employerAccountsApiClient;
 }