public void TestCannonShootIncorrectAngle() { Cannon cannon = Cannon.GetInstance(); var shot = cannon.Shoot(95, 100); Assert.IsFalse(shot.Item1); }
public void TestCannonShootVelocityGreaterThanSpeedOfLight() { Cannon cannon = Cannon.GetInstance(); var shot = cannon.Shoot(45, 300000001); Assert.IsFalse(shot.Item1); }
public void TestCannonMultipleInstances() { Cannon cannon = Cannon.GetInstance(); Cannon cannon2 = Cannon.GetInstance(); Assert.IsTrue(cannon == cannon2); }
public void TestCannonCountShots() { Cannon cannon = Cannon.GetInstance(); cannon.SetTarget(12621); var shot = cannon.Shoot(45, 350); Assert.IsTrue(shot.Item2 == "Hit - 1 Shot(s)", "Number of shots:" + cannon.Shots); }
public void TestCannonShootHit() { Cannon cannon = Cannon.GetInstance(); cannon.SetTarget(12621); var shot = cannon.Shoot(45, 350); Assert.IsTrue(shot.Item2 == "Hit -1 shots(s)"); }
public void TestCannonShootMiss() { Cannon cannon = Cannon.GetInstance(); cannon.SetTarget(4000); var shot = cannon.Shoot(45, 350); Assert.IsFalse(shot.Item2 == "Missed cannonball landed at 12621 meters"); }
public void TestCannonMissDistance() { Cannon cannon = Cannon.GetInstance(); cannon.SetTarget(12621); var shot = cannon.shoot(45, 300); Assert.IsTrue(cannon.DistanceFromTarget(cannon.DistanceOfTarget, cannon.CalculateDistanceOfCannonShot(45, 300)) == -3288); }
public void TestCannonShootMiss() { Cannon cannon = Cannon.GetInstance(); cannon.SetTarget(4000); var shot = cannon.Shoot(45, 350); Assert.IsTrue(shot.Item1 == false); }
public void TestCannonHitPerson() { Cannon cannon = Cannon.GetInstance(); cannon.SetTarget(6900); cannon.SetPerson(12621); var shot = cannon.Shoot(45, 350); Assert.IsTrue(shot.Item2 == "You hit a person and killed them. You lose.");//Confirms you hit a person not a target. }
public void CannonIDVaild() { Cannon cannon = Cannon.GetInstance(); Assert.IsNotNull(cannon.ID); }