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);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public void TestEmptyCollection()
        {
            var weatherData = new WeatherDataAnalysis.Model.WeatherDataCollection();

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