public override void Given() { ViewModel.CanRejoin = true; mockResponse = new RejoinRegistrationResponse { IsSuccess = false }; RegistrationLoader.RejoinRegistrationAsync(AoUkprn, ViewModel).Returns(mockResponse); }
public override void Given() { ViewModel.CanRejoin = true; mockResponse = new RejoinRegistrationResponse { ProfileId = 1, Uln = 7654332198, IsSuccess = true, }; RegistrationLoader.RejoinRegistrationAsync(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.RejoinRegistrationConfirmationViewModel); MockResult = new RejoinRegistrationResponse { ProfileId = 1, Uln = 123456789 }; }
public async override Task When() { ActualResult = await Loader.RejoinRegistrationAsync(AoUkprn, ViewModel); }