예제 #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.
        }
예제 #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.
        }
예제 #3
0
        public void TestConstructor()
        {
            SunshineMeasurement sm;

            sm = new SunshineMeasurement("Eindhoven");

            Assert.AreEqual("Eindhoven", sm.Cityname);
        }
예제 #4
0
        public void TestAdding1MaximumSunshines()
        {
            SunshineMeasurement sm;

            sm = new SunshineMeasurement("Eindhoven");

            sm.addSunshineOfLastDay(100);

            Assert.AreEqual("Eindhoven", sm.Cityname);
            Assert.AreEqual(100, sm.getMaximumSunshine());
        }
예제 #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());
        }