Esempio n. 1
0
        public IList <Domain.Models.PostcodeLookup> CreatePostcodeLookup(int postcodeCount = 1)
        {
            var postcodes = new List <Domain.Models.PostcodeLookup>();

            _context.AddRange(
                Enumerable.Range(1, postcodeCount).Select(index =>
                                                          new Domain.Models.PostcodeLookup
            {
                Postcode         = $"POST PO{index}",
                PrimaryLepCode   = "LEP000001",
                SecondaryLepCode = "LEP000002",
                CreatedBy        = "Sfa.Tl.Matching.Application.IntegrationTests"
            }));

            _context.AddRange(postcodes);
            _context.SaveChanges();

            return(postcodes);
        }
Esempio n. 2
0
        public When_SqlSearchProvider_Search_Opportunities_Is_Called_With_Valid_Parameters_With_One_Venue_Enabled()
        {
            var logger = Substitute.For <ILogger <Data.SearchProviders.SqlSearchProvider> >();

            _dbContext = new TestConfiguration().GetDbContext();

            _providerVenues = new ValidProviderVenueSearchBuilder().BuildWithOneVenueEnabled();
            _dbContext.AddRange(_providerVenues);
            _dbContext.SaveChanges();

            var provider = new Data.SearchProviders.SqlSearchProvider(logger, _dbContext);

            _results = provider.SearchOpportunitiesByPostcodeProximityAsync(new OpportunityProximitySearchParametersDto {
                Postcode = "CV1 2WT", SearchRadius = 5, SelectedRouteId = 7, Latitude = "52.400997", Longitude = "-1.508122"
            }).GetAwaiter().GetResult();
        }
        internal static void Load(MatchingDbContext context)
        {
            context.AddRange(EmailTemplateData.Create().ToList());
            context.AddRange(EmployerData.Create().ToList());
            context.AddRange(RouteAndPathData.Create().ToList());
            context.AddRange(ProviderVenueData.Create());
            context.AddRange(OpportunityData.Create());
            context.AddRange(ServiceStatusHistoryData.Create().ToList());
            context.AddRange(LearningAimReferenceData.Create().ToList());
            context.AddRange(OpportunityData.CreateReferralSingle());
            context.AddRange(OpportunityData.CreateProvisionGapSingle());
            context.AddRange(OpportunityData.CreateReferralMultiple());
            context.AddRange(OpportunityData.CreateReferralMultipleAndProvisionGap());
            context.AddRange(OpportunityData.CreateReferralSingleAndProvisionGap());
            context.AddRange(OpportunityData.CreateProvidersMultiple());
            context.AddRange(OpportunityData.CreateNReferrals(1000));

            context.SaveChanges();
        }