コード例 #1
0
        public void Robots_GetSumOfArea_NoRobots_ShouldReturnEmptyArea()
        {
            Robots robots    = new Robots();
            double sumOfArea = robots.GetSumOfArea();

            Assert.AreEqual(0, sumOfArea, 0.001, "Summe der mähbaren Fläche stimmt nicht");
        }
コード例 #2
0
        public void Robots_GetSumOfArea_NoMowers_ShouldReturnEmptyArea()
        {
            Robots       robots = new Robots();
            Drone        dron   = new Drone("Drone1", 10.5, 100.5);
            DrivingRobot funCar = new DrivingRobot("FunCar", 33.5, 55.5);
            bool         ok     = robots.AddRobot(dron);

            ok = robots.AddRobot(funCar);
            double sumOfArea = robots.GetSumOfArea();

            Assert.AreEqual(0, sumOfArea, 0.001, "Summe der mähbaren Fläche stimmt nicht");
        }
コード例 #3
0
        public void Robots_GetSumOfArea_FourRobots_ShouldReturnCorrectArea()
        {
            Robots       robots = new Robots();
            Drone        dron   = new Drone("Drone1", 10.5, 100.5);
            Mower        mower  = new Mower("Mower", 6.3, 1.2, 250.22);
            Mower        mower2 = new Mower("Mower2", 8.3, 1.2, 255.5);
            DrivingRobot funCar = new DrivingRobot("FunCar", 33.5, 55.5);
            bool         ok     = robots.AddRobot(mower);

            ok = robots.AddRobot(dron);
            ok = robots.AddRobot(funCar);
            ok = robots.AddRobot(mower2);
            double sumOfArea = robots.GetSumOfArea();

            Assert.AreEqual(505.72, sumOfArea, 0.001, "Summe der mähbaren Fläche stimmt nicht");
        }