コード例 #1
0
        public void ThenTheTemperatureIsWarmerThanDegrees(string minimumTemperature)
        {
            double expectedMinumumTemp = Convert.ToDouble(minimumTemperature);
            var    responseBody        = JObject.Parse(Response.Content);
            var    listOfForecasts     = JArray.Parse(responseBody["list"].ToString());

            foreach (var forecast in listOfForecasts)
            {
                if (IsForecastFortheDayOfTheHoliday(forecast))
                {
                    GetMinimumTemperature(forecast);
                }
            }
            MinimumTemp.Count.Should().BeGreaterThan(0, "We need the forecast for the day of the holiday");
            MinimumTemp.Min().Should().BeGreaterThan(expectedMinumumTemp, "It should be warmer");
        }
コード例 #2
0
        private void GetMinimumTemperature(JToken forecast)
        {
            var minimumTempForQuarter = forecast["main"]["temp_min"].Value <double>();

            MinimumTemp.Add(minimumTempForQuarter);
        }