コード例 #1
0
        public async Task RetrievesAverageHighs()
        {
            // arrange
            int placeId = 105989;

            // act
            var temperature = await _climateRepository.GetTemperature(placeId);

            // assert
            Assert.That(temperature.MonthlyAverageHighs, Is.Not.Null);
            Assert.That(temperature.MonthlyAverageHighs, Is.Not.Null);
            Assert.That(temperature.MonthlyAverageHighs.Length, Is.EqualTo(12));

            Assert.That(temperature.MonthlyAverageHighs.All(t => t >= 0 && t < 25), Is.True);

            Console.WriteLine(string.Join(' ', temperature.MonthlyAverageHighs));
        }
コード例 #2
0
 public async Task <Temperature> Temperature(int placeId)
 {
     return(await _climateRepository.GetTemperature(placeId));
 }