Exemplo n.º 1
0
        public void RobotManagerChargesProperly()
        {
            RobotManager robotManager = new RobotManager(1);
            Robot        robot        = new Robot("Pesho", 100);

            robotManager.Add(robot);
            robotManager.Work(robot.Name, "da", 100);

            robotManager.Charge(robot.Name);

            Assert.That(robot.Battery, Is.EqualTo(robot.MaximumBattery));
        }
Exemplo n.º 2
0
        public void ThrowsExceptionOnChargingNullRobot()
        {
            RobotManager robotManager = new RobotManager(1);

            Assert.That(() => robotManager.Charge("d"), Throws.InvalidOperationException.With.Message.EqualTo($"Robot with the name d doesn't exist!"));
        }