public void TestOneDataPoint() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { new WeatherInfo(DateTime.Today.AddDays(-3), 50, 40) }); Assert.AreEqual(40, collection.GetAverageLow()); }
public void TestTwoDataPoints() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { new WeatherInfo(DateTime.Today.AddDays(-3), 0, -10), new WeatherInfo(DateTime.Today, 100, 90) }); Assert.AreEqual(40, collection.GetAverageLow()); }
public void TestManyDataPointsDecimalAnswer() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo> { new WeatherInfo(DateTime.Today.AddDays(-3), 5, 2), new WeatherInfo(DateTime.Today, 100, 97), new WeatherInfo(DateTime.Today, 100, 43) }); Assert.AreEqual(47.33, collection.GetAverageLow(), .009); }
public void TestZeroDataPoints() { var collection = new WeatherInfoCollection("Test1", new List <WeatherInfo>()); Assert.AreEqual(double.MinValue, collection.GetAverageLow()); }