public override void Setup() { HttpContextAccessor = Substitute.For <IHttpContextAccessor>(); RegistrationLoader = Substitute.For <IRegistrationLoader>(); CacheService = Substitute.For <ICacheService>(); Logger = Substitute.For <ILogger <ManageRegistrationController> >(); Controller = new ManageRegistrationController(RegistrationLoader, CacheService, Logger); ProfileId = 1; AoUkprn = 1234567890; var httpContext = new ClaimsIdentityBuilder <ManageRegistrationController>(Controller) .Add(CustomClaimTypes.Ukprn, AoUkprn.ToString()) .Add(CustomClaimTypes.UserId, Guid.NewGuid().ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); CacheKey = CacheKeyHelper.GetCacheKey(httpContext.User.GetUserId(), CacheConstants.ReregisterCacheKey); ViewModel = new ReregisterCoreViewModel(); }
public override void Given() { Ukprn = 1000001; TqProviderId = 1; TlProviderId = 5; var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); TempData = new TempDataDictionary(HttpContextAccessor.HttpContext, Substitute.For <ITempDataProvider>()); Controller.TempData = TempData; ViewModel = new ProviderTlevelDetailsViewModel { Id = TqProviderId, TlProviderId = TlProviderId, CanRemoveTlevel = true, ShowBackToProvidersLink = true }; ProviderLoader.RemoveTqProviderTlevelAsync(Ukprn, TqProviderId).Returns(true); }
public override void Setup() { HttpContextAccessor = Substitute.For <IHttpContextAccessor>(); RegistrationLoader = Substitute.For <IRegistrationLoader>(); CacheService = Substitute.For <ICacheService>(); Logger = Substitute.For <ILogger <ManageRegistrationController> >(); Controller = new ManageRegistrationController(RegistrationLoader, CacheService, Logger); AoUkprn = 1234567890; var httpContext = new ClaimsIdentityBuilder <ManageRegistrationController>(Controller) .Add(CustomClaimTypes.Ukprn, AoUkprn.ToString()) .Add(CustomClaimTypes.UserId, Guid.NewGuid().ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); CacheKey = string.Concat(CacheKeyHelper.GetCacheKey(httpContext.User.GetUserId(), CacheConstants.RegistrationCacheKey), Common.Helpers.Constants.WithdrawRegistrationConfirmationViewModel); MockResult = new WithdrawRegistrationResponse { ProfileId = 1, Uln = 123456789, IsRequestFromProviderAndCorePage = true }; }
public override void Setup() { HttpContextAccessor = Substitute.For <IHttpContextAccessor>(); RegistrationLoader = Substitute.For <IRegistrationLoader>(); CacheService = Substitute.For <ICacheService>(); Logger = Substitute.For <ILogger <ManageRegistrationController> >(); Controller = new ManageRegistrationController(RegistrationLoader, CacheService, Logger); ProfileId = 1; AoUkprn = 1234567890; var httpContext = new ClaimsIdentityBuilder <ManageRegistrationController>(Controller) .Add(CustomClaimTypes.Ukprn, AoUkprn.ToString()) .Add(CustomClaimTypes.UserId, Guid.NewGuid().ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); ViewModel = new ChangeCoreQuestionViewModel(); MockResult = new ProviderChangeResponse(); CacheKey = string.Concat(CacheKeyHelper.GetCacheKey(httpContext.User.GetUserId(), CacheConstants.RegistrationCacheKey), Common.Helpers.Constants.ChangeRegistrationProviderCoreNotSupportedViewModel); }
public override void Given() { Ukprn = 10011881; TqProviderId = 1; var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); mockresult = new ProviderTlevelDetailsViewModel { Id = _tlProviderId, DisplayName = "Test", Ukprn = 10000111, TlevelTitle = "Test Title", TlProviderId = _tlProviderId }; ProviderLoader.GetTqProviderTlevelDetailsAsync(Ukprn, TqProviderId).Returns(mockresult); }
public override void Setup() { ResultsAndCertificationConfiguration = new ResultsAndCertificationConfiguration { SoaAvailableDate = "10/08/2021".ToDateTime() }; CacheService = Substitute.For <ICacheService>(); Logger = Substitute.For <ILogger <StatementOfAchievementController> >(); StatementOfAchievementLoader = Substitute.For <IStatementOfAchievementLoader>(); ProviderAddressLoader = Substitute.For <IProviderAddressLoader>(); Controller = new StatementOfAchievementController(StatementOfAchievementLoader, ProviderAddressLoader, CacheService, ResultsAndCertificationConfiguration, Logger); ProviderUkprn = 1234567890; var httpContext = new ClaimsIdentityBuilder <StatementOfAchievementController>(Controller) .Add(CustomClaimTypes.Ukprn, ProviderUkprn.ToString()) .Add(CustomClaimTypes.UserId, Guid.NewGuid().ToString()) .Build() .HttpContext; HttpContextAccessor = Substitute.For <IHttpContextAccessor>(); HttpContextAccessor.HttpContext.Returns(httpContext); CacheKey = CacheKeyHelper.GetCacheKey(httpContext.User.GetUserId(), CacheConstants.SoaCacheKey); }
public override void Setup() { HttpContextAccessor = Substitute.For <IHttpContextAccessor>(); RegistrationLoader = Substitute.For <IRegistrationLoader>(); CacheService = Substitute.For <ICacheService>(); Logger = Substitute.For <ILogger <ManageRegistrationController> >(); Controller = new ManageRegistrationController(RegistrationLoader, CacheService, Logger); AoUkprn = 1234567890; var httpContext = new ClaimsIdentityBuilder <ManageRegistrationController>(Controller) .Add(CustomClaimTypes.Ukprn, AoUkprn.ToString()) .Add(CustomClaimTypes.UserId, Guid.NewGuid().ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); CacheKey = CacheKeyHelper.GetCacheKey(httpContext.User.GetUserId(), CacheConstants.RegistrationCacheKey); ViewModel = new ChangeDateofBirthViewModel { Day = "1", Month = "2", Year = "2000" }; MockResult = new ManageRegistrationResponse(); }
public void Setup() { userService = Substitute.For <IUserService>(); sut = new ClaimsIdentityBuilder(userService); }