Exemple #1
0
        public void Then_Search_Should_Throw_Exception()
        {
            Action action = () =>
                            _provider.SearchProvidersByPostcodeProximityForReportAsync(
                new ProviderProximitySearchParametersDto
            {
                Postcode       = "CV1 2WT",
                SearchRadius   = 5,
                SelectedRoutes = new List <int>(),
                Latitude       = "",
                Longitude      = ""
            }).GetAwaiter().GetResult();

            action.Should().ThrowExactly <InvalidOperationException>();
        }
        public When_SqlSearchProvider_Search_Providers_For_Report_Is_Called_With_No_Selected_Routes()
        {
            var logger = Substitute.For <ILogger <Data.SearchProviders.SqlSearchProvider> >();

            _dbContext = new TestConfiguration().GetDbContext();

            _providerVenue = new ValidProviderVenueSearchBuilder().BuildOneVenue();
            _dbContext.Add(_providerVenue);
            _dbContext.SaveChanges();

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

            _results = provider.SearchProvidersByPostcodeProximityForReportAsync(
                new ProviderProximitySearchParametersDto
            {
                Postcode       = "CV1 2WT",
                SearchRadius   = 5,
                SelectedRoutes = null,
                Latitude       = "52.400997",
                Longitude      = "-1.508122"
            }).GetAwaiter().GetResult();
        }