package com.funnyhatsoftware.spacedock.test;

import android.test.AndroidTestCase;

import com.funnyhatsoftware.spacedock.data.Captain;
import com.funnyhatsoftware.spacedock.data.Set;
import com.funnyhatsoftware.spacedock.data.Ship;
import com.funnyhatsoftware.spacedock.data.Universe;
import com.funnyhatsoftware.spacedock.data.Upgrade;

public class TestShip extends AndroidTestCase {
	Universe universe;

	public TestShip() {
		super();
	}

	public void setUp() {
		universe = Universe.getUniverse(getContext());
	}

	public void testLoad() {
		Ship entD = universe.ships.get("1001");
		assertNotNull("Couldn't get ship", entD);
		assertEquals(4, entD.getAttack());
		assertEquals("U.S.S. Enterprise-D", entD.getTitle());
		assertTrue("U.S.S. Enterprise-D should be unique", entD.getUnique());

		Captain picard = universe.captains.get("2001");
		assertNotNull("Couldn't get captain", picard);
		assertEquals(9, picard.getSkill());
		assertEquals("Jean-Luc Picard", picard.getTitle());
		assertTrue("Picard should be unique", picard.getUnique());

		Upgrade romulanPilot = universe.upgrades.get("3102");
		assertNotNull("Couldn't get upgrade", romulanPilot);
		assertEquals("Romulan Pilot", romulanPilot.getTitle());
		assertEquals(2, romulanPilot.getCost());
		assertFalse("Romulan Pilot should not be unique",
				romulanPilot.getUnique());

		Set coreSet = universe.sets.get("71120");
		assertNotNull("Couldn't get core set", coreSet);
		assertEquals("Count of items in core set wrong", 30, coreSet.getItems()
				.size());

		Set reliantSet = universe.sets.get("71121");
		assertNotNull("Couldn't get core set", reliantSet);
		assertEquals("Count of items in reliant expansion wrong", 12,
				reliantSet.getItems().size());
	}

}

@@ -129,16 +129,122 @@
 aptain;%0A
+import com.funnyhatsoftware.spacedock.data.Flagship;%0Aimport com.funnyhatsoftware.spacedock.data.Resource;%0A
 import c
@@ -1442,24 +1442,465 @@
 Unique());%0A%0A
+%09%09Flagship fs = universe.flagships.get(%226002%22);%0A%09%09assertNotNull(%22Couldn't get flagship%22, fs);%0A%09%09assertEquals(%22attack value wrong%22, 1, fs.getAttack());%0A%09%09assertEquals(%22hull value wrong%22, 0, fs.getHull());%0A%09%09assertEquals(%22faction wrong%22, %22Independent%22, fs.getFaction());%0A%09%09%0A%09%09Resource tokens = universe.resources.get(%224002%22);%0A%09%09assertNotNull(%22Couldn't get resource%22, tokens);%0A%09%09assertEquals(%22resource cost value wrong%22, 5, tokens.getCost());%0A%0A
 %09%09Set coreSe

Add smoke test for flagships and resources.