public void OverWeightWCMDTest() { B52 b52 = new B52(); Weapon WCMDWeapon = new Weapon(WeaponType.WCMD); b52.Weight = 485000; Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Left, WCMDWeapon)); Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Right, WCMDWeapon)); }
public void OverWeightGravityTest() { B52 b52 = new B52(); Weapon GravityWeapon = new Weapon(WeaponType.Gravity); b52.Weight = 485000; Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Left, GravityWeapon)); Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Right, GravityWeapon)); Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Bay, GravityWeapon)); }
public void OverWeightALCMTest() { B52 b52 = new B52(); Weapon ALCMWeapon = new Weapon(WeaponType.ALCM); b52.Weight = 485000; Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Left, ALCMWeapon)); Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Right, ALCMWeapon)); Assert.ThrowsException <WeightErrorException>(() => b52.AddWeapon(Storage.Bay, ALCMWeapon)); }
public void AddWCMDWeaponTest() { // Arrange B52 b52 = new B52(); Weapon WCMDWeapon = new Weapon(WeaponType.WCMD); int expected = 217648; // Act b52.AddWeapon(Storage.Left, WCMDWeapon); b52.AddWeapon(Storage.Right, WCMDWeapon); int actual = b52.CalcWeight(); // Assert Assert.AreEqual(expected, actual); Assert.ThrowsException <LoadErrorException>(() => b52.AddWeapon(Storage.Left, WCMDWeapon)); Assert.ThrowsException <LoadErrorException>(() => b52.AddWeapon(Storage.Right, WCMDWeapon)); Assert.ThrowsException <LoadErrorException>(() => b52.AddWeapon(Storage.Bay, WCMDWeapon)); }