public void MultipleForcastAlerts() { List <string> expected = new List <string> { "Snow Alert for Saturday, March 10", "Ice Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "ice and snow")); }
public void ForcastAndTemp_GeneratesTwoAlerts() { List <string> expected = new List <string> { "Freezing Temperature Alert for Saturday, March 10", "Ice Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result = AlertGenerator.generateAlerts(new Forcast(date, -40, 70, "ice")); }
public void NoAlerts_ReturnsEmptyList() { List <string> expected = new List <string>(); DateTime date = new DateTime(2018, 3, 10); var result = AlertGenerator.generateAlerts(new Forcast(date, 40, 50, "Nothing")); CollectionAssert.AreEqual(expected, result); }
public void HighTempAt85_GeneratesHighHeatAlert() { List <string> expected = new List <string> { "High Heat Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result = AlertGenerator.generateAlerts(new Forcast(date, 50, 85, "Nothing")); CollectionAssert.AreEqual(expected, result); }
public void LowTempAt32_GeneratesFreezingTempAlert() { List <string> expected = new List <string> { "Freezing Temperature Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result = AlertGenerator.generateAlerts(new Forcast(date, 32, 50, "Nothing")); CollectionAssert.AreEqual(expected, result); }
public void LowTempBelow32_And_HighTempAbove85_GeneratesTwoAlerts() { List <string> expected = new List <string> { "Freezing Temperature Alert for Saturday, March 10", "High Heat Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result = AlertGenerator.generateAlerts(new Forcast(date, 30, 90, "Nothing")); CollectionAssert.AreEqual(expected, result); }
public void LowTempLessThan32_GeneratesFreezingTempAlert() { List <string> expected = new List <string> { "Freezing Temperature Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result1 = AlertGenerator.generateAlerts(new Forcast(date, 0, 50, "Nothing")); CollectionAssert.AreEqual(expected, result1); var result2 = AlertGenerator.generateAlerts(new Forcast(date, 20, 70, "Nothing")); CollectionAssert.AreEqual(expected, result2); var result3 = AlertGenerator.generateAlerts(new Forcast(date, -60, -40, "Nothing")); CollectionAssert.AreEqual(expected, result2); }
public void ForcastContainsIce_GeneratesIceAlert() { List <string> expected = new List <string> { "Ice Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result1 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "Ice")); CollectionAssert.AreEqual(expected, result1); var result2 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "black ice")); CollectionAssert.AreEqual(expected, result2); var result3 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "some more ice")); CollectionAssert.AreEqual(expected, result2); }
public void ForcastContainsSnow_GeneratesSnowAlert() { List <string> expected = new List <string> { "Snow Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result1 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "Snow")); CollectionAssert.AreEqual(expected, result1); var result2 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "light snow")); CollectionAssert.AreEqual(expected, result2); var result3 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "Scattered Snow")); CollectionAssert.AreEqual(expected, result2); }
public void ForcastContainsThunderstorm_GeneratesThunderstormAlert() { List <string> expected = new List <string> { "Thunderstorm Alert for Saturday, March 10" }; DateTime date = new DateTime(2018, 3, 10); var result1 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "Thunderstorms")); CollectionAssert.AreEqual(expected, result1); var result2 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "Scattered Thunderstorms")); CollectionAssert.AreEqual(expected, result2); var result3 = AlertGenerator.generateAlerts(new Forcast(date, 50, 70, "Heavy Thunderstorm")); CollectionAssert.AreEqual(expected, result2); }
public void LowTemp_AboveHighTemp_ThrowsException() { DateTime date = new DateTime(2018, 3, 10); var result = AlertGenerator.generateAlerts(new Forcast(date, 70, 60, "Nothing")); }