public void AddRobot_ThrowException() { RobotManager rm = new RobotManager(10); rm.Add(robot); Assert.Throws <InvalidOperationException>(() => rm.Add(robot)); }
public void Add_NotEnoughCapacity() { robotManager = new RobotManager(1); robotManager.Add(new Robot("Gosho", 5)); Assert.That(() => robotManager.Add(new Robot("Pesho", 6)), Throws.InvalidOperationException); }
public void AddingSameRobot_ExceptionShouldBeThrown() { Assert.Throws <InvalidOperationException>(() => { manager.Add(robot); manager.Add(robot); }); }
public void WhenDataIsCorrectShouldWork() { RobotManager manager = new RobotManager(3); manager.Add(robot); manager.Add(new Robot("test2", 12)); Assert.AreEqual(2, manager.Count); }
public void AddShouldThrowExceptionWhenARobotWithSameNameIsAdded() { RobotManager robotManager = new RobotManager(10); robotManager.Add(this.robot); Assert.Throws <InvalidOperationException>(() => robotManager.Add(new Robot(this.robot.Name, 50))); }
public void AddRobot_ExceptionCapacity() { RobotManager rm = new RobotManager(2); rm.Add(robot); rm.Add(new Robot("roro", 12)); Assert.Throws <InvalidOperationException>(() => rm.Add(new Robot("kkk", 11))); }
public void CountShouldChangeWhenAddingOrRemovingRobots() { robotManager.Add(robot); Assert.AreEqual(1, robotManager.Count); robotManager.Remove(robot.Name); Assert.AreEqual(0, robotManager.Count); }
public void WhenRobotManagerIsAddedAgain_ShoudThrowException() { manager.Add(robot); Assert.Throws <InvalidOperationException>(() => { manager.Add(robot); }); }
public void AddShouldIncreaseCount() { robotManager = new RobotManager(2); robotManager.Add(robot); robotManager.Add(secondRobot); Assert.That(robotManager.Count, Is.EqualTo(2)); }
public void AddShouldThrowExceptionWhenCapacityIsExceeded() { RobotManager robotManager = new RobotManager(1); robotManager.Add(this.robot); Assert .Throws <InvalidOperationException>(() => robotManager.Add(new Robot("Bobbie", 50))); }
public void AddingRobotOvarCapacity_ExceptionShouldBeThrown() { Assert.Throws <InvalidOperationException>(() => { RobotManager robotManager = new RobotManager(1); robotManager.Add(robot); robotManager.Add(new Robot("New", 20)); }); }
public void TestingCounter() { RobotManager manager = new RobotManager(2); manager.Add(new Robot("eee", 200)); manager.Add(new Robot("eeee", 2003)); Assert.AreEqual(2, manager.Count); }
public void AddMethodShouldThrowExceptionWhenTryToAddSame() { RobotManager manager = new RobotManager(2); manager.Add(this.robot); Assert.Throws <InvalidOperationException>(() => manager.Add(this.robot)); }
public void ChargeRobot_Ok() { RobotManager rm = new RobotManager(50); rm.Add(robot); rm.Add(new Robot("k", 10)); rm.Charge("name"); Assert.That(robot.Battery, Is.EqualTo(100)); }
public void WorkRobot_Ok() { RobotManager rm = new RobotManager(50); rm.Add(robot); rm.Add(new Robot("k", 10)); rm.Work("name", "job", 10); Assert.That(robot.Battery, Is.EqualTo(90)); }
public void TestingAdder_ShouldThrowExcCapacity() { RobotManager manager = new RobotManager(1); Robot robot = new Robot("er", 100); manager.Add(robot); Assert.Throws <InvalidOperationException>(() => manager.Add(new Robot("3123", 20))); }
public void AddRobotWithExistingNameShouldThrowException() { robotManager = new RobotManager(5); robotManager.Add(robot); Assert.Throws <InvalidOperationException>(() => { robotManager.Add(robot); }); }
public void ChargeRobot_Exception() { RobotManager rm = new RobotManager(50); rm.Add(robot); rm.Add(new Robot("k", 10)); Robot robotRemove = new Robot("roro", 10); Assert.Throws <InvalidOperationException>(() => rm.Charge("roro")); }
public void WorkShouldDecreaseBattery() { robotManager = new RobotManager(2); robotManager.Add(robot); robotManager.Add(secondRobot); robotManager.Work(secondRobot.Name, "clean", 10); Assert.That(secondRobot.Battery, Is.EqualTo(30)); }
public void RemoveShouldWorkCorrectly() { robotManager = new RobotManager(2); robotManager.Add(robot); robotManager.Add(secondRobot); robotManager.Remove(secondRobot.Name); Assert.That(robotManager.Count, Is.EqualTo(1)); }
public void RobotManagerShouldThrowExceptionForInvalidCapacity() { var robot = new Robot("Acho", 4); var robotManager = new RobotManager(1); robotManager.Add(robot); Assert.Throws <InvalidOperationException>(() => robotManager.Add(new Robot("Acho", 5))); }
public void TestRemoveRobot() { RobotManager manager = new RobotManager(4); manager.Add(new Robot("Test1", 25)); manager.Add(new Robot("Test2", 25)); manager.Remove("Test2"); Assert.AreEqual(1, manager.Count); }
public void ThrowExceptionIfRobotAlreadyExists() { Assert.Throws <InvalidOperationException>(() => { RobotManager manager = new RobotManager(3); manager.Add(robot); Robot newRobot = new Robot("TestName", 10); manager.Add(newRobot); }); }
public void RobotManagerAddMethethodShouldThrowExceptionForInvalidCapacity() { var robot = new Robot("Viktor", 80); var robotManager = new RobotManager(1); robotManager.Add(robot); Assert.Throws <InvalidOperationException>(() => robotManager.Add(robot)); }
public void AddShouldThrowExceptionWhenReachesCapacity() { robotManager = new RobotManager(1); robotManager.Add(robot); Assert.Throws <InvalidOperationException>(() => { robotManager.Add(robot); }); }
public void ShouldThrowWhenRobotWithSameNameAddedPreviously() { var robotManager = new RobotManager(3); var robot = new Robot("asd", 312); robotManager.Add(robot); Assert .Throws <InvalidOperationException>(() => robotManager.Add(robot)); }
public void ShouldThrowWhenAddingWithNotEnoughCapacity() { var robotManager = new RobotManager(1); var robot = new Robot("asd", 312); robotManager.Add(robot); Assert .Throws <InvalidOperationException>(() => robotManager.Add(robot)); }
public void AddindRobotWithSameNameShouldThrowException() { var robot = new Robot("Acho", 4); var robotManager = new RobotManager(100); robotManager.Add(robot); Assert.Throws <InvalidOperationException>(() => robotManager.Add(new Robot("Acho", 5))); }
public void WorkRobot_ExceptionName() { RobotManager rm = new RobotManager(50); rm.Add(robot); rm.Add(new Robot("k", 10)); Robot robotRemove = new Robot("roro", 10); Assert.Throws <InvalidOperationException>(() => rm.Work("roro", "job", 2)); }
public void RemoveRobot_Ok() { RobotManager rm = new RobotManager(50); rm.Add(robot); rm.Add(new Robot("k", 10)); Robot robotRemove = new Robot("roro", 10); rm.Remove("k"); Assert.That(rm.Count, Is.EqualTo(1)); }