Exemplo n.º 1
0
 public HomeController(IOwinWrapper owinWrapper, HomeOrchestrator homeOrchestrator,
                       EmployerApprenticeshipsServiceConfiguration configuration, IFeatureToggle featureToggle, IMultiVariantTestingService multiVariantTestingService, ICookieStorageService <FlashMessageViewModel> flashMessage)
     : base(owinWrapper, featureToggle, multiVariantTestingService, flashMessage)
 {
     _homeOrchestrator = homeOrchestrator;
     _configuration    = configuration;
 }
 public HomeController(IAuthenticationService owinWrapper, HomeOrchestrator homeOrchestrator,
                       EmployerAccountsConfiguration configuration, IAuthorizationService authorization,
                       IMultiVariantTestingService multiVariantTestingService, ICookieStorageService <FlashMessageViewModel> flashMessage)
     : base(owinWrapper, multiVariantTestingService, flashMessage)
 {
     _homeOrchestrator = homeOrchestrator;
     _configuration    = configuration;
 }
        public void Arrange()
        {
            _mediator = new Mock <IMediator>();
            _mediator.Setup(x => x.SendAsync(It.IsAny <GetUserAccountsQuery>())).ReturnsAsync(new GetUserAccountsQueryResponse {
                Accounts = new Accounts <Account>()
            });
            _mediator.Setup(x => x.SendAsync(It.IsAny <GetNumberOfUserInvitationsQuery>())).ReturnsAsync(new GetNumberOfUserInvitationsResponse {
                NumberOfInvites = 2
            });


            _homeOrchestrator = new HomeOrchestrator(_mediator.Object);
        }
 public HomeController(IAuthenticationService owinWrapper,
                       HomeOrchestrator homeOrchestrator,
                       EmployerAccountsConfiguration configuration,
                       IMultiVariantTestingService multiVariantTestingService,
                       ICookieStorageService <FlashMessageViewModel> flashMessage,
                       ICookieStorageService <ReturnUrlModel> returnUrlCookieStorageService,
                       ILog logger)
     : base(owinWrapper, multiVariantTestingService, flashMessage)
 {
     _homeOrchestrator = homeOrchestrator;
     _configuration    = configuration;
     _returnUrlCookieStorageService = returnUrlCookieStorageService;
     _logger = logger;
 }
Exemplo n.º 5
0
        public void Arrange()
        {
            _user = new User
            {
                Id        = 1,
                Email     = "*****@*****.**",
                FirstName = "test",
                LastName  = "tester",
                UserRef   = Guid.NewGuid().ToString()
            };

            _mediator = new Mock <IMediator>();
            _mediator.Setup(x => x.SendAsync(It.IsAny <GetUsersQuery>()))
            .ReturnsAsync(new GetUsersQueryResponse
            {
                Users = new List <User>
                {
                    _user
                }
            });
            _homeOrchestrator = new HomeOrchestrator(_mediator.Object);
        }
Exemplo n.º 6
0
        public void CreateAccountWithOwner(EmployerAccountOrchestrator orchestrator, IMediator mediator, Mock <IAuthenticationService> owinWrapper, HomeOrchestrator homeOrchestrator)
        {
            var accountOwnerUserId = Guid.NewGuid().ToString();

            ScenarioContext.Current["AccountOwnerUserRef"] = accountOwnerUserId;

            var signInUserModel = new UserViewModel
            {
                UserRef   = accountOwnerUserId,
                Email     = "*****@*****.**" + Guid.NewGuid().ToString().Substring(0, 6),
                FirstName = "Test",
                LastName  = "Tester"
            };

            var userCreationSteps = new UserSteps();

            userCreationSteps.UpsertUser(signInUserModel);

            var user = userCreationSteps.GetExistingUserAccount();

            CreateDasAccount(user, _container.GetInstance <EmployerAccountOrchestrator>());

            ScenarioContext.Current["AccountOwnerUserId"] = user.Id;
        }