public void TestOneDaysInMonth()
        {
            var testWeatherInfo = new WeatherInfo(DateTime.Parse("1/2/2007"), 0, -10);
            var collection      = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testWeatherInfo
            });
            var result   = collection.GetHighestInMonth(1);
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testWeatherInfo
            });

            Assert.IsTrue(expected.SequenceEqual(result));
        }
        public void TestTwoDaysInMonthLowBoundry()
        {
            var testinfo1S = new WeatherInfo(DateTime.Parse("1/2/2007"), 0, -10);
            var testinfo2  = new WeatherInfo(DateTime.Parse("1/2/2007"), -1, -10);
            var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2
            });
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S
            });
            var result = collection.GetHighestInMonth(1);

            Assert.IsTrue(expected.SequenceEqual(result));
        }
        public void TestTwoDaysInMonthEquals()
        {
            var testinfo1S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0);
            var testinfo2S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0);
            var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2S
            });
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2S
            });
            var result = collection.FindHighestLowTemps();

            Assert.IsTrue(expected.SequenceEqual(result));
        }
        public void TestManyDaysInMonthTempertureSequence()
        {
            var testinfo1  = new WeatherInfo(DateTime.Parse("1/2/2007"), -1, -10);
            var testinfo2  = new WeatherInfo(DateTime.Parse("1/2/2007"), 0, -10);
            var testinfo3S = new WeatherInfo(DateTime.Parse("1/2/2007"), 1, -10);

            var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1,
                testinfo2,
                testinfo3S
            });
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo3S
            });
            var result = collection.GetHighestInMonth(1);

            Assert.IsTrue(expected.SequenceEqual(result));
        }
        public void TestManyDaysInMonthTempertureSequenceFirstIsHighest()
        {
            var testinfo1S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 1);
            var testinfo2  = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0);
            var testinfo3  = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, -1);

            var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2,
                testinfo3
            });
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S
            });
            var result = collection.FindHighestLowTemps();

            Assert.IsTrue(expected.SequenceEqual(result));
        }
Example #6
0
        public void TestManyDaysInMonthTempertureSequenceSecondIsLowest()
        {
            var testinfo1  = new WeatherInfo(DateTime.Parse("1/2/2007"), 1, -10);
            var testinfo2S = new WeatherInfo(DateTime.Parse("1/2/2007"), -1, -10);
            var testinfo3  = new WeatherInfo(DateTime.Parse("1/2/2007"), 0, -10);

            var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1,
                testinfo2S,
                testinfo3
            });
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo2S
            });
            var result = collection.FindLowestHighTemps();

            Assert.IsTrue(expected.SequenceEqual(result));
        }
        public void TestManyDaysInOutsidemonthBehindInTime()
        {
            var testinfo1S = new WeatherInfo(DateTime.Parse("1/2/2007"), 0, -10);
            var testinfo2S = new WeatherInfo(DateTime.Parse("1/2/2007"), 0, -10);
            var testinfo3  = new WeatherInfo(DateTime.Parse("2/1/2007"), 0, -10);

            var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2S,
                testinfo3
            });
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2S
            });
            var result = collection.GetHighestInMonth(1);

            Assert.IsTrue(expected.SequenceEqual(result));
        }
        public void TestManyDaysInMonthDuplicate()
        {
            var testinfo1S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, -1);
            var testinfo2S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, -1);
            var testinfo3  = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0);

            var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2S,
                testinfo3
            });
            var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> {
                testinfo1S,
                testinfo2S
            });
            var result = collection.GetLowestInMonth(1);

            Assert.IsTrue(expected.SequenceEqual(result));
        }