public void Arrange() { _geocodeService = new Mock <IGeocodeService>(); _mappingService = new Mock <IMappingService>(); _vacanciesApi = new Mock <ILivevacanciesAPI>(); _standardsService = new Mock <IStandardsRepository>(); _vacanciesMapper = new VacanciesMapper(); _logger = new Mock <ILogger <VacanciesRepository> >(); _countryMapper = new CountryMapper(); _standards = new List <int>() { 1, 2 }; _standardIds = string.Join(',', _standards); _geocodeService.Setup(s => s.GetFromPostCode(It.IsAny <string>())).ReturnsAsync(coordinatesResponse); _vacanciesApi.Setup(s => s.SearchApprenticeshipVacanciesByLocationAsync(It.IsAny <double>(), It.IsAny <double>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>())).ReturnsAsync(GetSearchResults.MockSearchResults(coordinatesResponse)); _standardsService.Setup(s => s.GetByRoute(routeId)).ReturnsAsync(_standards); sut = new VacanciesRepository(_vacanciesApi.Object, _vacanciesMapper, _geocodeService.Object, _mappingService.Object, _logger.Object, _countryMapper, _standardsService.Object); }
public void Arrange() { _geocodeService = new Mock <IGeocodeService>(); _mappingService = new Mock <IMappingService>(); _vacanciesApi = new Mock <ILivevacanciesAPI>(); _vacanciesMapper = new VacanciesMapper(); _logger = new Mock <ILogger <VacanciesRepository> >(); _countryMapper = new CountryMapper(); _geocodeService.Setup(s => s.GetFromPostCode(It.IsAny <string>())).ReturnsAsync(coordinatesResponse); sut = new VacanciesRepository(_vacanciesApi.Object, _vacanciesMapper, _geocodeService.Object, _mappingService.Object, _logger.Object, _countryMapper, Mock.Of <IStandardsRepository>()); _standardIds = null; }
public void Arrange() { _geocodeService = new Mock <IGeocodeService>(); _mappingService = new Mock <IMappingService>(); _vacanciesApi = new Mock <ILivevacanciesAPI>(); _vacanciesMapper = new VacanciesMapper(); _logger = new Mock <ILogger <VacanciesRepository> >(); _countryMapper = new CountryMapper(); _geocodeService.Setup(s => s.GetFromPostCode(It.IsAny <string>())).ReturnsAsync(coordinatesResponse); _vacanciesApi.Setup(s => s.SearchApprenticeshipVacanciesByLocationAsync(It.IsAny <double>(), It.IsAny <double>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>())).ReturnsAsync(GetSearchResults.MockSearchResults(coordinatesResponse)); _mappingService.Setup(s => s.GetStaticMapsUrl(It.IsAny <SFA.DAS.Campaign.Domain.Vacancies.Location>())).Returns("url"); sut = new VacanciesRepository(_vacanciesApi.Object, _vacanciesMapper, _geocodeService.Object, _mappingService.Object, _logger.Object, _countryMapper, Mock.Of <IStandardsRepository>()); }