public void TestNoDaysInCollection() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { }); Assert.ThrowsException <InvalidOperationException>(() => collection.GetLowestInMonth(1)); }
public void TestNoDaysInMonth() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { new WeatherInfo(DateTime.Parse("2/2/2007"), 10, 0) }); Assert.ThrowsException <InvalidOperationException>(() => collection.GetLowestInMonth(1)); }
public void TestOneDaysInMonth() { var testWeatherInfo = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0); var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { testWeatherInfo }); var result = collection.GetLowestInMonth(1); var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> { testWeatherInfo }); Assert.IsTrue(expected.SequenceEqual(result)); }
public void TestTwoDaysInMonthHighBoundry() { var testinfo1S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0); var testinfo2 = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 1); var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { testinfo1S, testinfo2 }); var expected = new WeatherInfoCollection("Test1", new List <WeatherInfo> { testinfo1S }); var result = collection.GetLowestInMonth(1); Assert.IsTrue(expected.SequenceEqual(result)); }
public void TestManyDaysInMonthTempertureSequence() { 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.GetLowestInMonth(1); Assert.IsTrue(expected.SequenceEqual(result)); }
public void TestManyDaysInOutsidemonthBehindInTime() { var testinfo1S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0); var testinfo2S = new WeatherInfo(DateTime.Parse("1/2/2007"), 10, 0); var testinfo3 = new WeatherInfo(DateTime.Parse("2/1/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)); }