public void WhenChargeNotExisting_ExeptionShouldBeThrownn() { Assert.Throws <InvalidOperationException>(() => { manager.Charge("Nqma me"); }); }
public void WhenChargeNotExisitng_ShouldThrowException() { Assert.Throws <InvalidOperationException>(() => { robotManager.Charge("NotExisitng"); }); }
public void RobotManager_Charge_Should_ThrowException_When_TryToChargeUnexistingRobot() { robotManager.Add(robot); var invalid = new Robot("Invalid", 1); Assert.Throws <InvalidOperationException>(() => robotManager.Charge(invalid.Name)); }
public void ChargeMethodWorkCorrectly() { robotManager.Add(robot); robotManager.Work(robot.Name, robot.Name, 1); robotManager.Charge(robot.Name); Assert.AreEqual(10, robot.Battery); }
public void ChargeThrowsException_WhenRobotWithNoSuchNameIsGiven() { robotManager.Add(new Robot("Robot", 10)); Assert.Throws <InvalidOperationException> (() => robotManager.Charge("NoSuchNameExists")); }
public void TestIChargekMethodThrowsExceptionIfNotFound() { robotManager.Add(robot); Assert.Throws <InvalidOperationException>( () => robotManager.Charge("gfdgdf") //,$"Robot with the name {robot.Name} doesn't exist!" ); }
public void Charge_ChecksIfItWorksWithValidInput() { Robot robot = new Robot("Spencer", 40); robotManager.Add(robot); int bateryUsage = 5; robotManager.Work("Spencer", "Digging", bateryUsage); robotManager.Charge("Spencer"); Assert.That(robot.Battery, Is.EqualTo(robot.MaximumBattery)); }
public void ChargeShouldThrowExceptionWhenRobotIsNotFound() { var robotManager = new RobotManager(10); Assert.Throws <InvalidOperationException>(() => robotManager.Charge("TestName")); }
public void WhenChargeRobotBattShuldGetmaximmu() { manager.Add(robot); manager.Work(robot.Name, "jov", 5); manager.Charge(robot.Name); Assert.AreEqual(robot.Battery, 10); }
public void ChargeShouldThrowExceptionWhenRobotNotFound() { string robotName = "Bobbie"; RobotManager robotManager = new RobotManager(1); robotManager.Add(this.robot); Assert.Throws <InvalidOperationException>(() => robotManager.Charge(robotName)); }
public void ChargeMethod_RobotManager_Check_ThrownInvalidOperationExceptionIfLowBattery() { int capacity = 1; RobotManager robotManager = new RobotManager(capacity); string name = "A"; Assert.That(() => robotManager.Charge(name), Throws.InvalidOperationException.With.Message.EqualTo($"Robot with the name {name} doesn't exist!")); }
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 ThrowExceptionIfRobotToChargeDoesNotExist() { Assert.Throws <InvalidOperationException>(() => { RobotManager manager = new RobotManager(2); manager.Charge("NoName"); }); }
public void ChargeShouldThrowExceptionForInvalidRobot() { var robot = new Robot("Acho", 20); var robotManager = new RobotManager(1); robotManager.Add(robot); Assert.Throws <InvalidOperationException>(() => robotManager.Charge("Ely")); }
public void RobotManagerChargeShouldThrowInvalidOperationExceptionWhenRobotIsNull() { var rb = new RobotManager(1); var robotname = "Ivan"; Assert.Throws <InvalidOperationException>(() => { rb.Charge(robotname); }, $"Robot with the name {robotname} doesn't exist!"); }
public void CheckWheterChargeThrowsExceptionIfRobotIsNull() { robot = new Robot(name, maxBatery); robotManager = new RobotManager(capacity); Assert.Throws <InvalidOperationException>(() => { robotManager.Charge("NaNi"); }); }
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 WhenExistingRobotCharges_ShoudChargeCorrectly() { RobotManager roboManager = new RobotManager(1); roboManager.Add(robot); roboManager.Work("Test", "raboti", 1); roboManager.Work("Test", "raboti", 1); roboManager.Charge("Test"); Assert.AreEqual(robot.MaximumBattery, robot.Battery); }
public void ChargeShouldIncreaseBatteryToItsMaximum() { RobotManager robotManager = new RobotManager(1); this.robot.Battery = 55; robotManager.Add(this.robot); robotManager.Charge(this.robot.Name); Assert.AreEqual(this.robot.MaximumBattery, this.robot.Battery); }
public void WhenUnexistingRobotCharges_ShoudThrowException() { RobotManager roboManager = new RobotManager(1); roboManager.Add(robot); Assert.Throws <InvalidOperationException>(() => { roboManager.Charge("ivan"); }); }
public void Charge_Method_Should_Throw_An_Exception_If_The_Robot_Is_Null() { var robotManager = new RobotManager(1); var robot = new Robot("Ivan", 100); robotManager.Add(robot); Assert.Throws <InvalidOperationException>( () => robotManager.Charge(null), "Robot is not null."); }
public void ShouldChargeWhenRobotExists() { var robotManager = new RobotManager(1); var robot = new Robot("d", 5); robotManager.Add(robot); robotManager.Work("d", "cleaning", 3); robotManager.Charge("d"); Assert.AreEqual(5, robot.Battery); }
public void ShouldThrowWhenChargingNonexistentRobot() { var robotManager = new RobotManager(1); var robot = new Robot("d", 5); robotManager.Add(robot); robotManager.Work("d", "cleaning", 3); Assert .Throws <InvalidOperationException>(() => robotManager.Charge("x")); }
public void Charge_Method_Should_Charge_The_Robot_Correctly() { var robotManager = new RobotManager(1); var robot = new Robot("Ivan", 100); robotManager.Add(robot); robotManager.Work("Ivan", "Kravar", 80); robotManager.Charge("Ivan"); Assert.That(robot.Battery, Is.EqualTo(100)); }
public void ChargeShouldThrowsExceptionWhenRobbotDoesntExist() { RobotManager robotManager = new RobotManager(10); string invalidName = "Pesho"; Assert.Throws <InvalidOperationException>(() => { robotManager.Charge(invalidName); }, $"Robot with the name {invalidName} doesn't exist!"); }
public void ChargeRobotWhitWork_Sccess() { RobotManager rm = new RobotManager(50); rm.Add(robot); rm.Work("name", "job", 5); rm.Charge("name"); Assert.AreEqual(robot.Battery, 100); Assert.AreEqual(robot.Battery, robot.MaximumBattery); Assert.That(robot.Battery, Is.EqualTo(robot.MaximumBattery)); }
public void ChargeMethodShouldThrowExceptionIfRobotNameIsInvalid() { RobotManager robotManager = new RobotManager(1); robotManager.Add(testRobot1); Assert.Throws <InvalidOperationException>(() => { robotManager.Charge("invalid name"); }); }
public void ChargeShouldThrowExceptionWhenRobotsNotFound() { RobotManager robotManager = new RobotManager(1); robotManager.Add(this.robot); Assert.Throws <InvalidOperationException>(() => { robotManager.Charge("Simkata"); }); }
public void ChargeShouldThrowExceptionWhenNonexistingRobotName() { robotManager = new RobotManager(2); robotManager.Add(robot); robotManager.Add(secondRobot); Assert.Throws <InvalidOperationException>(() => { robotManager.Charge("Opa"); }); }
public void ChargeShouldSetToMaximum() { var robot = new Robot("Acho", 20); var robotManager = new RobotManager(1); robotManager.Add(robot); robotManager.Work("Acho", "Cleaning", 15); robotManager.Charge("Acho"); Assert.AreEqual(20, robot.Battery); }