Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }