Ejemplo n.º 1
0
        public void Setup()
        {
            _configuration = new EmployerAccountsConfiguration {
                Hmrc = new HmrcConfiguration()
            };
            _logger        = new Mock <ILog>();
            _cookieService = new Mock <ICookieStorageService <EmployerAccountData> >();
            _mediator      = new Mock <IMediator>();

            _payeScheme = new PayeSchemeView
            {
                Ref       = EmpRef,
                Name      = SchemeName,
                AddedDate = DateTime.Now
            };

            _mediator
            .Setup(x => x.SendAsync(It.IsAny <GetEmployerEnglishFractionQuery>()))
            .ReturnsAsync(new GetEmployerEnglishFractionResponse {
                Fractions = new List <DasEnglishFraction>()
            });

            _mediator.Setup(x => x.SendAsync(It.IsAny <GetPayeSchemeByRefQuery>()))
            .ReturnsAsync(new GetPayeSchemeByRefResponse
            {
                PayeScheme = _payeScheme
            });

            _orchestrator = new EmployerAccountPayeOrchestrator(_mediator.Object, _logger.Object, _cookieService.Object, _configuration);
        }
Ejemplo n.º 2
0
 public EmployerAccountPayeController(
     IAuthenticationService owinWrapper,
     EmployerAccountPayeOrchestrator employerAccountPayeOrchestrator,
     IMultiVariantTestingService multiVariantTestingService,
     ICookieStorageService <FlashMessageViewModel> flashMessage,
     IMediator mediatr) : base(owinWrapper, multiVariantTestingService, flashMessage)
 {
     _employerAccountPayeOrchestrator = employerAccountPayeOrchestrator;
     _mediatr = mediatr;
 }
        public void Arrange()
        {
            _mediator      = new Mock <IMediator>();
            _logger        = new Mock <ILogger>();
            _cookieService = new Mock <ICookieStorageService <EmployerAccountData> >();
            _configuration = new EmployerApprenticeshipsServiceConfiguration();
            new Mock <IEmpRefFileBasedService>();

            _employerAccountPayeOrchestrator = new EmployerAccountPayeOrchestrator(_mediator.Object, _logger.Object, _cookieService.Object, _configuration);
        }
        public void Arrange()
        {
            _model = new ConfirmNewPayeSchemeViewModel
            {
                AccessToken     = Guid.NewGuid().ToString(),
                RefreshToken    = Guid.NewGuid().ToString(),
                HashedAccountId = ExpectedHashedId,
                PayeScheme      = ExpectedEmpref,
                PayeName        = ExpectedEmprefName
            };

            _configuration = new EmployerApprenticeshipsServiceConfiguration {
                Hmrc = new HmrcConfiguration()
            };

            _logger        = new Mock <ILogger>();
            _cookieService = new Mock <ICookieStorageService <EmployerAccountData> >();

            _mediator = new Mock <IMediator>();
            _mediator.Setup(x => x.SendAsync(It.IsAny <GetAccountLegalEntitiesRequest>())).ReturnsAsync(new GetAccountLegalEntitiesResponse {
                Entites = new LegalEntities {
                    LegalEntityList = new List <LegalEntity>()
                }
            });
            _mediator.Setup(x => x.SendAsync(It.Is <GetGatewayTokenQuery>(c => c.AccessCode.Equals("1")))).ReturnsAsync(new GetGatewayTokenQueryResponse {
                HmrcTokenResponse = new HmrcTokenResponse {
                    AccessToken = "1"
                }
            });
            _mediator.Setup(x => x.SendAsync(It.Is <GetHmrcEmployerInformationQuery>(c => c.AuthToken.Equals("1")))).ReturnsAsync(new GetHmrcEmployerInformationResponse {
                Empref = "123/ABC", EmployerLevyInformation = new EmpRefLevyInformation {
                    Employer = new Employer {
                        Name = new Name {
                            EmprefAssociatedName = ExpectedEmprefName
                        }
                    }
                }
            });
            _mediator.Setup(x => x.SendAsync(It.Is <GetHmrcEmployerInformationQuery>(c => c.AuthToken.Equals("2")))).ReturnsAsync(new GetHmrcEmployerInformationResponse {
                Empref = "456/ABC", EmployerLevyInformation = new EmpRefLevyInformation {
                    Employer = new Employer {
                        Name = new Name {
                            EmprefAssociatedName = ExpectedEmprefName
                        }
                    }
                }
            });

            _employerAccountPayeOrchestrator = new EmployerAccountPayeOrchestrator(_mediator.Object, _logger.Object, _cookieService.Object, _configuration);
        }
        public EmployerAccountPayeController(
            IAuthenticationService owinWrapper,
            EmployerAccountPayeOrchestrator employerAccountPayeOrchestrator,
            IAuthorizationService authorization,
            IMultiVariantTestingService multiVariantTestingService,
            ICookieStorageService <FlashMessageViewModel> flashMessage) : base(owinWrapper, multiVariantTestingService, flashMessage)
        {
            if (owinWrapper == null)
            {
                throw new ArgumentNullException(nameof(owinWrapper));
            }

            _employerAccountPayeOrchestrator = employerAccountPayeOrchestrator ?? throw new ArgumentNullException(nameof(employerAccountPayeOrchestrator));
        }
Ejemplo n.º 6
0
        public EmployerAccountPayeController(IOwinWrapper owinWrapper, EmployerAccountPayeOrchestrator employerAccountPayeOrchestrator,
                                             IFeatureToggle featureToggle, IMultiVariantTestingService multiVariantTestingService, ICookieStorageService <FlashMessageViewModel> flashMessage)
            : base(owinWrapper, featureToggle, multiVariantTestingService, flashMessage)
        {
            if (owinWrapper == null)
            {
                throw new ArgumentNullException(nameof(owinWrapper));
            }
            if (employerAccountPayeOrchestrator == null)
            {
                throw new ArgumentNullException(nameof(employerAccountPayeOrchestrator));
            }

            _employerAccountPayeOrchestrator = employerAccountPayeOrchestrator;
        }
        public void Arrange()
        {
            _configuration = new EmployerAccountsConfiguration();

            _logger        = new Mock <ILog>();
            _cookieService = new Mock <ICookieStorageService <EmployerAccountData> >();
            _mediator      = new Mock <IMediator>();
            _mediator.Setup(x => x.SendAsync(It.IsAny <GetTeamMemberQuery>())).ReturnsAsync(new GetTeamMemberResponse {
                User = new MembershipView {
                    ShowWizard = true, Role = Role.Owner
                }
            });

            _orchestrator = new EmployerAccountPayeOrchestrator(_mediator.Object, _logger.Object, _cookieService.Object, _configuration);
        }
Ejemplo n.º 8
0
        public void Arrange()
        {
            _configuration = new EmployerAccountsConfiguration {
                Hmrc = new HmrcConfiguration()
            };

            _logger        = new Mock <ILog>();
            _cookieService = new Mock <ICookieStorageService <EmployerAccountData> >();

            _mediator = new Mock <IMediator>();
            _mediator.Setup(x => x.SendAsync(It.IsAny <GetEmployerEnglishFractionQuery>())).ReturnsAsync(new GetEmployerEnglishFractionResponse {
                Fractions = new List <DasEnglishFraction>()
            });

            _employerAccountPayeOrchestrator = new EmployerAccountPayeOrchestrator(_mediator.Object, _logger.Object, _cookieService.Object, _configuration);
        }
        public void Arrange()
        {
            _payeScheme = new PayeSchemeView
            {
                Ref       = EmpRef,
                Name      = SchemeName,
                AddedDate = DateTime.Now
            };

            _mediator = new Mock <IMediator>();

            _mediator.Setup(x => x.SendAsync(It.IsAny <GetPayeSchemeByRefQuery>()))
            .ReturnsAsync(new GetPayeSchemeByRefResponse
            {
                PayeScheme = _payeScheme
            });

            _logger        = new Mock <ILog>();
            _cookieService = new Mock <ICookieStorageService <EmployerAccountData> >();
            _configuration = new EmployerAccountsConfiguration();
            new Mock <IEmpRefFileBasedService>();

            _employerAccountPayeOrchestrator = new EmployerAccountPayeOrchestrator(_mediator.Object, _logger.Object, _cookieService.Object, _configuration);
        }