예제 #1
0
        public void SetNewWeatherTargetTestCityName()
        {
            IWeatherConnection weatherConnection = new OpenWeatherConnection();

            weatherConnection.City = "Krosno";
            Assert.AreEqual(weatherConnection.City, "Krosno");
        }
예제 #2
0
        public void Parsing()
        {
            var weather = new OpenWeatherConnection();
            var s       = TemplateJSON.ParseAPIData("main", "temp_max", "\":", "0123456789.");
            var result  = double.Parse(s, CultureInfo.InvariantCulture);

            Assert.AreEqual(286.48, result);
        }
예제 #3
0
        public void GetWeatherAgainTest()
        {
            var weather = new OpenWeatherConnection();

            weather.City = "Krosno";
            IWeatherData data = weather.GetWeatherData();

            Assert.AreNotEqual(data, WeatherData.ERRORMODEL);
        }
예제 #4
0
        public void TestMultiHours()
        {
            OpenWeatherConnection weather = new OpenWeatherConnection();

            weather.City = "Warsaw";
            IDateWeatherData data = weather.GetDateWeatherData();

            Assert.IsNotNull(data.DateTimes);
            Assert.IsNotNull(data.WeatherDatas);
            Assert.AreEqual(data.DateTimes.Count, data.WeatherDatas.Count);
        }
예제 #5
0
        public void GetWeatherDataTest()
        {
            var weather = new OpenWeatherConnection();

            weather.City = "Krosno";
            IWeatherData data = weather.GetWeatherData();

            Assert.AreNotEqual(data, WeatherData.ERRORMODEL);
            Assert.IsNotNull(data.MainInformation);
            Assert.IsNotNull(data.Description);
            Assert.IsNotNull(data.KelvinTemperature);
            Assert.IsNotNull(data.Humidity);
            Assert.IsNotNull(data.WindDegree);
            Assert.IsNotNull(data.WindSpeed);
        }