public void setCurrentConditions(String weatherDescription) { this.currentConditions = weatherDescription; if (weatherDescription == "rainy") { String alert = phone.generateWeatherAlert(weatherDescription); consoleOutput.Add(alert); } if (weatherDescription == "sunny") { String alert = emailer.generateWeatherAlert(weatherDescription); consoleOutput.Add(alert); } }
public void testGeneratesAlertString() { Emailer emailer = new Emailer(); Assert.Equal("It is sunny", emailer.generateWeatherAlert("sunny")); }