Exemplo n.º 1
0
        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}"));
        }
Exemplo n.º 2
0
        public WeatherData Index(string location)
        {
            WebDataService temp = new WebDataService(new DownloadStringService());

            return(temp.GetData(location));
        }