Exemplo n.º 1
0
        public void Robots_GetSumOfPower_NoRobots_ShouldReturnZeroPower()
        {
            Robots robots     = new Robots();
            double sumOfPower = robots.GetSumOfPower();

            Assert.AreEqual(0, sumOfPower, 0.001, "Summe der Leistung stimmt nicht");
        }
Exemplo n.º 2
0
        public void Robots_GetSumOfPower_OneRobot_ShouldReturnCorrectPower()
        {
            Robots robots     = new Robots();
            Drone  dron       = new Drone("Drone1", 10.5, 100.5);
            bool   ok         = robots.AddRobot(dron);
            double sumOfPower = robots.GetSumOfPower();

            Assert.AreEqual(10.5, sumOfPower, 0.001, "Summe der Leistung stimmt nicht");
        }
Exemplo n.º 3
0
        public void Robots_GetSumOfPower_FourRobots_ShouldReturnCorrectPower()
        {
            Robots       robots = new Robots();
            Drone        dron   = new Drone("Drone1", 10.5, 100.5);
            Mower        mower  = new Mower("Mower", 6.5, 1.2, 250);
            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 sumOfPower = robots.GetSumOfPower();

            Assert.AreEqual(58.8, sumOfPower, 0.001, "Summe der Leistung stimmt nicht");
        }