Ejemplo n.º 1
0
        public void TestNoMaximumSunshine()
        {
            SunshineMeasurement sm;

            sm = new SunshineMeasurement("Eindhoven");

            int bla = sm.getMaximumSunshine();  // Now an exception should be thrown since there are no sunshines added.
        }
Ejemplo n.º 2
0
        public void TestAdding0DaysOfSunshine()
        {
            SunshineMeasurement sm;

            sm = new SunshineMeasurement("Eindhoven");

            int bla = sm.getAverageSunshine();  // Now an exception should be thrown since a division by zero must happen.
        }
Ejemplo n.º 3
0
        public void TestConstructor()
        {
            SunshineMeasurement sm;

            sm = new SunshineMeasurement("Eindhoven");

            Assert.AreEqual("Eindhoven", sm.Cityname);
        }
Ejemplo n.º 4
0
        public void TestAdding1MaximumSunshines()
        {
            SunshineMeasurement sm;

            sm = new SunshineMeasurement("Eindhoven");

            sm.addSunshineOfLastDay(100);

            Assert.AreEqual("Eindhoven", sm.Cityname);
            Assert.AreEqual(100, sm.getMaximumSunshine());
        }
Ejemplo n.º 5
0
        public void TestAdding2DaysOfSunshine()
        {
            SunshineMeasurement sm;

            sm = new SunshineMeasurement("Eindhoven");

            sm.addSunshineOfLastDay(100);
            sm.addSunshineOfLastDay(200);

            Assert.AreEqual("Eindhoven", sm.Cityname);
            Assert.AreEqual(150, sm.getAverageSunshine());
        }