Beispiel #1
0
        public void TestCollectionSize1()
        {
            var weatherData = new WeatherDataAnalysis.Model.WeatherDataCollection {
                new WeatherData(DateTime.Now, 90, 40)
            };

            Assert.AreEqual(40, weatherData.GetDaysWithHighestLowTempByYear()[0].Low);
        }
        public void TestCollectionSize1()
        {
            var weatherData = new WeatherDataAnalysis.Model.WeatherDataCollection {
                new WeatherData(DateTime.Now, 90, 40)
            };

            Assert.AreEqual(90, weatherData.GetAverageHighTempForYear());
        }
Beispiel #3
0
        public void TestCollectionSize3()
        {
            var weatherData = new WeatherDataAnalysis.Model.WeatherDataCollection
            {
                new WeatherData(DateTime.Now, 90, 70),
                new WeatherData(DateTime.Now.AddDays(1), 100, 50),
                new WeatherData(DateTime.Now.AddDays(2), 70, 40)
            };

            Assert.AreEqual(70, weatherData.GetDaysWithHighestLowTempByYear()[0].Low);
        }
        public void TestCollectionSize3()
        {
            var weatherData = new WeatherDataAnalysis.Model.WeatherDataCollection
            {
                new WeatherData(DateTime.Now, 90, 70),
                new WeatherData(DateTime.Now.AddDays(1), 100, 50),
                new WeatherData(DateTime.Now.AddDays(2), 74, 40)
            };

            Assert.AreEqual(88, weatherData.GetAverageHighTempForYear());
        }
Beispiel #5
0
        public void TestEmptyCollection()
        {
            var weatherData = new WeatherDataAnalysis.Model.WeatherDataCollection();

            Assert.ThrowsException <InvalidOperationException>(() => weatherData.GetDaysWithHighestLowTempByYear());
        }