public Form1() { InitializeComponent(); weatherSubject = new WeatherSubject(); temperatureObserver = new TemperatureObserver(listTemperature, weatherSubject); averageObserver = new AverageObserver(listAverages, weatherSubject); forecastObserver = new ForecastObserver(listForecast, weatherSubject); }
public void ForecastObserver_PredictForecastWithOneReading_ReturnsPrediction() { ForecastObserver forecastObserver = new ForecastObserver(listBox, weatherSubject); forecastObserver.Update(15, 50, 102); string expected = "asteroids will hit the earth."; string actual = forecastObserver.prediction; Assert.AreEqual(expected, actual); }
public void ForecastObserver_PredictForecastWithTwoReadings_ReturnsPrediction() { ForecastObserver forecastObserver = new ForecastObserver(listBox, weatherSubject); forecastObserver.Update(15, 50, 102); forecastObserver.Update(15, 50, 98); string expected = "showers likely, perhaps hail"; string actual = forecastObserver.prediction; Assert.AreEqual(expected, actual); }