public override void Given() { Ukprn = 10011881; var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); mockresult = new YourProvidersViewModel { Providers = new List <ProviderDetailsViewModel> { new ProviderDetailsViewModel { ProviderId = 1, DisplayName = "Test", Ukprn = 10000111 }, new ProviderDetailsViewModel { ProviderId = 2, DisplayName = "Display", Ukprn = 10000112 } } }; ProviderLoader.GetYourProvidersAsync(Ukprn).Returns(mockresult); }
public override void Given() { var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); ProviderLoader.IsAnyProviderSetupCompletedAsync(Ukprn).Returns(true); _mockresult = new ProviderTlevelsViewModel { ProviderId = 1, DisplayName = _searchText, Ukprn = 10000111, IsAddTlevel = true, Tlevels = new List <ProviderTlevelViewModel> { new ProviderTlevelViewModel { TqAwardingOrganisationId = 1, TlProviderId = 1, TlevelTitle = "Route1: Pathway1" }, new ProviderTlevelViewModel { TqAwardingOrganisationId = 1, TlProviderId = 1, TlevelTitle = "Route1: Pathway1" } } }; ProviderLoader.GetSelectProviderTlevelsAsync(Arg.Any <long>(), Arg.Any <int>()).Returns(_mockresult); }
public override int GetHashCode() { unchecked { var hashCode = LearnerUln.GetHashCode(); hashCode = (hashCode * 397) ^ (PriceEpisodeIdentifierForComparison != null ? PriceEpisodeIdentifierForComparison.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Ukprn.GetHashCode(); hashCode = (hashCode * 397) ^ ContractType; hashCode = (hashCode * 397) ^ TransactionType; hashCode = (hashCode * 397) ^ SfaContributionPercentageToCompare.GetHashCode(); hashCode = (hashCode * 397) ^ AmountToCompare.GetHashCode(); hashCode = (hashCode * 397) ^ CollectionPeriod; hashCode = (hashCode * 397) ^ AcademicYear; hashCode = (hashCode * 397) ^ DeliveryPeriod; hashCode = (hashCode * 397) ^ (LearnerReferenceNumber != null ? LearnerReferenceNumber.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LearningAimReference != null ? LearningAimReference.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ProgrammeType.GetHashCode(); hashCode = (hashCode * 397) ^ StandardCode.GetHashCode(); hashCode = (hashCode * 397) ^ FrameworkCode.GetHashCode(); hashCode = (hashCode * 397) ^ PathwayCode.GetHashCode(); hashCode = (hashCode * 397) ^ (LearningAimFundingLineType != null ? LearningAimFundingLineType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ AccountId.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = Ukprn.GetHashCode(); hashCode = (hashCode * 397) ^ StringComparer.OrdinalIgnoreCase.GetHashCode(LearnRefNumber); hashCode = (hashCode * 397) ^ AimSeqNumber; return(hashCode); } }
public override void Given() { var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); ProviderLoader.IsAnyProviderSetupCompletedAsync(Ukprn).Returns(true); }
public AuthorizationContextProviderTestsFixture SetValidUkprn() { Ukprn = 456; UkprnClaimValue = Ukprn.ToString(); var ukprnClaimValue = UkprnClaimValue; AuthenticationService.Setup(a => a.TryGetUserClaimValue(ProviderClaims.Ukprn, out ukprnClaimValue)).Returns(true); return(this); }
public override int GetHashCode() { unchecked { var hash = 17; hash = 31 * hash + Ukprn.GetHashCode(); hash = 31 * hash + PaymentType.GetHashCode(); hash = 31 * hash + Period.GetHashCode(); //hash = 31 * hash + SubmissionId.GetHashCode(); return(hash); } }
public override void Given() { Ukprn = 10011881; TqProviderId = 0; var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); ViewModel = null; }
public override int GetHashCode() { unchecked { var hashCode = Ukprn.GetHashCode(); hashCode = (hashCode * 397) ^ Uln.GetHashCode(); hashCode = (hashCode * 397) ^ (FundingLineType != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(FundingLineType) : 0); hashCode = (hashCode * 397) ^ ContractType; hashCode = (hashCode * 397) ^ DeliveryPeriod; hashCode = (hashCode * 397) ^ TransactionType; hashCode = (hashCode * 397) ^ Amount.GetHashCode(); return(hashCode); } }
public bool IsValid() { if (string.IsNullOrEmpty(Name)) { return(false); } if (Ukprn.ToString().Length != 8) { return(false); } return(true); }
public override void Given() { Ukprn = 10011881; var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); var mockresult = new YourProvidersViewModel(); ProviderLoader.GetYourProvidersAsync(Ukprn) .Returns(mockresult); }
public override void Given() { Ukprn = 10011881; TqProviderId = 0; var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); ProviderTlevelDetailsViewModel mockresult = null; ProviderLoader.GetTqProviderTlevelDetailsAsync(Ukprn, TqProviderId) .Returns(mockresult); }
public override void Given() { Ukprn = 10011881; ProviderId = 1; var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); ProviderTlevelsViewModel mockresult = null; ProviderLoader.GetSelectProviderTlevelsAsync(Arg.Any <long>(), Arg.Any <int>()) .Returns(mockresult); }
public override int GetHashCode() { unchecked { var hashCode = (Ukprn != null ? Ukprn.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)ProviderType; hashCode = (hashCode * 397) ^ ContractedForNonLeviedEmployers.GetHashCode(); hashCode = (hashCode * 397) ^ ParentCompanyGuarantee.GetHashCode(); hashCode = (hashCode * 397) ^ NewOrganisationWithoutFinancialTrackRecord.GetHashCode(); hashCode = (hashCode * 397) ^ StartDate.GetHashCode(); hashCode = (hashCode * 397) ^ EndDate.GetHashCode(); hashCode = (hashCode * 397) ^ ApplicationDeterminedDate.GetHashCode(); hashCode = (hashCode * 397) ^ CurrentlyNotStartingNewApprentices.GetHashCode(); return(hashCode); } }
public override void Given() { var httpContext = new ClaimsIdentityBuilder <ProviderController>(Controller) .Add(CustomClaimTypes.Ukprn, Ukprn.ToString()) .Build() .HttpContext; HttpContextAccessor.HttpContext.Returns(httpContext); mockresult = new ProviderTlevelsViewModel { ProviderId = 1, DisplayName = "Test", Ukprn = 10000111, Tlevels = new List <ProviderTlevelViewModel>() }; ProviderLoader.GetSelectProviderTlevelsAsync(Arg.Any <long>(), Arg.Any <int>()).Returns(mockresult); }
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 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 int GetHashCode() { unchecked { var hashCode = (LearnerReferenceNumber != null ? LearnerReferenceNumber.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Ukprn.GetHashCode(); hashCode = (hashCode * 397) ^ (PriceEpisodeIdentifier != null ? PriceEpisodeIdentifier.GetHashCode() : 0); hashCode = (hashCode * 397) ^ DeliveryPeriod; hashCode = (hashCode * 397) ^ LearningAimProgrammeType.GetHashCode(); hashCode = (hashCode * 397) ^ LearningAimFrameworkCode.GetHashCode(); hashCode = (hashCode * 397) ^ LearningAimPathwayCode.GetHashCode(); hashCode = (hashCode * 397) ^ LearningAimStandardCode.GetHashCode(); hashCode = (hashCode * 397) ^ SfaContributionPercentage.GetHashCode(); hashCode = (hashCode * 397) ^ (LearningAimFundingLineType != null ? LearningAimFundingLineType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LearningAimReference != null ? LearningAimReference.GetHashCode() : 0); hashCode = (hashCode * 397) ^ TransactionType01.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType02.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType03.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType04.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType05.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType06.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType07.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType08.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType09.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType10.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType11.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType12.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType13.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType14.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType15.GetHashCode(); hashCode = (hashCode * 397) ^ TransactionType16.GetHashCode(); hashCode = (hashCode * 397) ^ ContractType; hashCode = (hashCode * 397) ^ AgreedPrice.GetHashCode(); return(hashCode); } }