Ejemplo n.º 1
0
        public async void GetMultipleCitiesWeatherReports()
        {
            _weatherAPI.Setup(x => x.GetWeatherInfo("Goa")).Returns(Task.FromResult(new DTO.WeatherAPIResponseData()
            {
                Name = "Goa", Main = new DTO.Main()
                {
                    Temp = 25.65
                }
            }));
            _weatherAPI.Setup(x => x.GetWeatherInfo("London")).Returns(Task.FromResult(new DTO.WeatherAPIResponseData()
            {
                Name = "London", Main = new DTO.Main()
                {
                    Temp = 75.65
                }
            }));

            var result = await temperatureService.ProcesRequests(new List <string>() { "Goa", "London" });

            Assert.NotNull(result);
            //highest will be he fierst element
            Assert.Equal(75.65, result.First().temp);
        }