public override void Given() { ViewModel.CanWithdraw = true; mockResponse = new WithdrawRegistrationResponse { IsSuccess = false }; RegistrationLoader.WithdrawRegistrationAsync(AoUkprn, ViewModel).Returns(mockResponse); }
public override void Given() { ViewModel.CanWithdraw = true; mockResponse = new WithdrawRegistrationResponse { ProfileId = 1, Uln = 7654332198, IsSuccess = true, IsRequestFromProviderAndCorePage = false }; RegistrationLoader.WithdrawRegistrationAsync(AoUkprn, ViewModel).Returns(mockResponse); }
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 async override Task When() { ActualResult = await Loader.WithdrawRegistrationAsync(AoUkprn, ViewModel); }