public void GivenALocationTheWebDataServiceShouldCallBbcService() { var downloadService = new Mock <IDownloadStringService>(); WebDataService service = new WebDataService(downloadService.Object); var location = "england"; service.GetData(location); downloadService.Verify(d => d.GetData <BbcWeatherResult>($"http://localhost:60350/Weather/{location}")); }
public WeatherData Index(string location) { WebDataService temp = new WebDataService(new DownloadStringService()); return(temp.GetData(location)); }