public void AddOverFuelTest() { // Arrange B52 b52 = new B52(); //Act // Assert Assert.ThrowsException <FuelErrorException>(() => b52.AddFuel(300001)); }
public void TakeOffLimitTest() { // Arrange B52 b52 = new B52(); b52.Weight = 200000; // Act // Assert Assert.ThrowsException <WeightErrorException>(() => b52.AddFuel(300000)); }
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 ClearFuelTest() { // Arrange B52 b52 = new B52(); int expected = 0; // Act int actual = b52.Fuel; // Assert Assert.AreEqual(expected, actual); }
public void ClearWeaponTest() { // Arrange B52 b52 = new B52(); int expected = 185000; // Act int actual = b52.Weight; // Assert Assert.AreEqual(expected, actual); }
public void AddFuelTest() { // Arrange B52 b52 = new B52(); int expected = 100000; // Act b52.AddFuel(100000); // Assert Assert.AreEqual(expected, b52.Fuel); }
public void CalcWeightTest() { // Arrange B52 b52 = new B52(); b52.Fuel = 100000; b52.Weight = 200000; int expected = 300000; // Act int actual = b52.CalcWeight(); // Assert Assert.AreEqual(expected, actual); }
public void IsReadyForTakeOffTest() { // Arrange B52 b52 = new B52(); bool expected = false; // Act bool actual = b52.IsReadyForTakeOff(); // Assert Assert.AreEqual(expected, actual); b52.Fuel = 100000; expected = true; actual = b52.IsReadyForTakeOff(); Assert.AreEqual(expected, actual); }
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)); }
public void B52Test() { // Arrange B52 b52 = new B52(); int expectInitWeight = 185000; int expectFuel = 0; // Act int actualWeight = b52.Weight; int actualFuel = b52.Fuel; // Assert Assert.AreEqual(expectInitWeight, actualWeight); Assert.AreEqual(expectFuel, actualFuel); Assert.IsNotNull(b52.LeftWing); Assert.IsNotNull(b52.RightWing); Assert.IsNotNull(b52.Bay); }