public void TestNoDaysInCollection() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { }); Assert.ThrowsException <InvalidOperationException>(() => collection.GetHighestInMonth(1)); }
public void TestNoDaysInMonth() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { new WeatherInfo(DateTime.Parse("2/2/2007"), 0, -10) }); Assert.ThrowsException <InvalidOperationException>(() => collection.GetHighestInMonth(1)); }
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 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 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)); }