Пример #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));
        }
Пример #2
0
        public void ThrowsExceptionOnWorkingNonExistedRobot()
        {
            RobotManager robotManager = new RobotManager(1);

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