import java.lang.InterruptedException;

import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.Before;

public class TestFlyerModel
{
	private FlyerModel flyerModel;

	@Before
	public void instantiate()
	{
		flyerModel = new FlyerModel(100, 100);
	}

	@Test
	public void testUpdate()
	{
		float dt = 89.7f;
		flyerModel.update(dt);

		assertEquals(flyerModel.getXPos(), (int)(100.0f - (.1 * dt)));
		assertEquals(flyerModel.getYPos(), (int)(100 + (Math.sin(Math.toRadians(20)) * 5)));
	}

	@Test
	public void testShootBullets()
	{
		boolean seenTrue = false;
		boolean seenFalse = false;

		while (!seenTrue || !seenFalse)
			if (flyerModel.shootBullet() == true)
				seenTrue = true;
			else
				seenFalse = true;
	}

	@Test
	public void testGetDrop()
	{
		boolean seenPickup = false;
		boolean seenWeaponPickup = false;
		boolean seenNull = false;

		Pickup pickup = null;

		while (!seenPickup || !seenWeaponPickup || !seenNull)
		{
			pickup = flyerModel.getDrop();

			if (pickup == null)
				seenNull = true;
			else if (pickup.getClass() == WeaponPickup.class)
				seenWeaponPickup = true;
			else if (pickup.getClass() == Pickup.class)
				seenPickup = true;
		}
	}
}

@@ -601,16 +601,168 @@
 false;%0A%0A
+%09%09assertEquals(FlyerModel.SHOOT_BULLET_MIN, 0);%0A%09%09assertEquals(FlyerModel.SHOOT_BULLET_MAX, 19);%0A%09%09assertEquals(FlyerModel.SHOOT_BULLET_CONDITION, 0);%0A%0A
 %09%09while 
@@ -916,24 +916,34 @@
 etDrop()%0A%09%7B%0A
+%09%09int i;%0A%0A
 %09%09boolean se
@@ -1037,22 +1037,369 @@
 ckup
- pickup = null
+%5B%5D pickups = null;%0A%09%09Pickup pickup = null;%0A%0A%09%09assertEquals(FlyerModel.DROP_BOMB_FRAGMENT_MIN, 0);%0A%09%09assertEquals(FlyerModel.DROP_BOMB_FRAGMENT_MAX, 4);%0A%09%09assertEquals(FlyerModel.DROP_BOMB_CONDITION, 1);%0A%0A%09%09assertEquals(FlyerModel.DROP_WEAPON_POD_MIN, 0);%0A%09%09assertEquals(FlyerModel.DROP_WEAPON_POD_MAX, 4);%0A%09%09assertEquals(FlyerModel.DROP_WEAPON_POD_CONDITION, 0)
 ;%0A%0A%09
@@ -1462,24 +1462,25 @@
 %09%7B%0A%09%09%09pickup
+s
  = flyerMode
@@ -1493,16 +1493,72 @@
 rop();%0A%0A
+%09%09%09for (i = 0; i %3C 2; i++) %7B%0A%09%09%09%09pickup = pickups%5Bi%5D;%0A%0A%09
 %09%09%09if (p
@@ -1572,16 +1572,17 @@
 = null)%0A
+%09
 %09%09%09%09seen
@@ -1589,32 +1589,33 @@
 Null = true;%0A%09%09%09
+%09
 else if (pickup.
@@ -1648,24 +1648,25 @@
 .class)%0A%09%09%09%09
+%09
 seenWeaponPi
@@ -1674,24 +1674,25 @@
 kup = true;%0A
+%09
 %09%09%09else if (
@@ -1726,24 +1726,25 @@
 .class)%0A%09%09%09%09
+%09
 seenPickup =
@@ -1750,16 +1750,21 @@
 = true;%0A
+%09%09%09%7D%0A
 %09%09%7D%0A%09%7D%0A%7D

Test probabilities of FlyerModel.