Ejemplo n.º 1
0
        public void ForecastObs_UpdateValues_ReturnsExpected()
        {
            //Create needed objects
            ListBox lb = new ListBox();
            WeatherSubject ws = new WeatherSubject();
            ForeCastObserver fcObs = new ForeCastObserver(lb,ws);

            //Update tobs with some values
            fcObs.Update(1, 1, 1);

            //Just test on temperature, for full code coverage id need:
            //~3 tests to cover each branch of temperature-related strings
            //*3 for the amount of forecast options (temp,humid,baro)
            string expected = "Nippy";
            string actual = fcObs.Temp;

            Assert.AreEqual(expected, actual);
        }