public void AttackTest() { VehicleUnit testAttacker = new VehicleUnit(100, 10, 10, float.MaxValue); VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue); testAttacker.AttackCost = 5; testAttacker.IsNotTesting = false; testAttacker.Attack(testDefender); int expected = 90; int actual = testDefender.Health; Assert.AreEqual(expected, actual); }
public void AttackIfAPIsGreaterThanAC() { VehicleUnit testAttacker = new VehicleUnit(100, 10, 10, float.MaxValue); VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue); testAttacker.AttackCost = 5; testAttacker.IsNotTesting = false; testAttacker.Attack(testDefender); int expectedAP = 5; int actualAP = testAttacker.ActionPoints; int expedtedHP = 90; int actualHP = testDefender.Health; Assert.AreEqual(expectedAP, actualAP); Assert.AreEqual(expedtedHP, actualHP); }
public void NoAttackIfACIsZero() { VehicleUnit testAttacker = new VehicleUnit(100, 10, 10, float.MaxValue); VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue); testAttacker.AttackCost = 0; testAttacker.IsNotTesting = false; testAttacker.Attack(testDefender); int expectedAP = 10; int actualAP = testAttacker.ActionPoints; int expedtedHP = 100; int actualHP = testDefender.Health; Assert.AreEqual(expectedAP, actualAP); Assert.AreEqual(expedtedHP, actualHP); }
public void NoDamageWhenLessThanZero() { VehicleUnit testAttacker = new VehicleUnit(100, -10, 10, float.MaxValue); VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue); testAttacker.AttackCost = 5; testAttacker.IsNotTesting = false; testAttacker.Attack(testDefender); int expedtedHP = 100; int actualHP = testDefender.Health; Assert.AreEqual(expedtedHP, actualHP); }