Methods Summary |
---|
public static void | main(java.lang.String[] args)
junit.textui.TestRunner.run(new TestSuite(TestGame.class));
|
public void | setUp()
this.game = new Game();
this.fighter = this.game.createFighter("001");
|
public static junit.framework.Test | suite()
// show how to run tests concurrently
TestSuite suite = new ActiveTestSuite();
suite.addTest(new TestGame("testCreateFighter"));
suite.addTest(new RepeatedTest(new TestGame("testGameInitialState"), 20));
suite.addTest(new RepeatedTest(new TestGame("testSameFighters"), 10));
suite.addTest(TestPerson.suite());
return suite;
//return new RepeatedTest(new TestSuite(TestGame.class), 1);
// TestSuite suite = new TestSuite();
// suite.addTest(new RepeatedTest(new TestGame("testCreateFighter"), 100));
// suite.addTest(new TestGame("testSameFighters"));
// suite.addTest(new TestGame("testGameInitialState"));
// return suite;
/*
TestSuite suite = new TestSuite(TestGame.class);
suite.addTest(new TestSuite(TestPerson.class));
return suite;
*/
|
public void | tearDown()
this.game.shutdown();
|
public void | testCreateFighter()
// System.out.println("Begin testCreateFigher()");
assertEquals("Fighter did not have the correct identifier",
"001", this.fighter.getId());
// System.out.println("End testCreateFighter()");
|
public void | testGameInitialState()
// System.out.println("Begin testGameInitialState()");
assertTrue("A new game should not be started yet",
!this.game.isPlaying());
// System.out.println("End testGameInitialState()");
|
public void | testSameFighters()
// System.out.println("Begin testSameFighters()");
Ship fighter2 = this.game.createFighter("001");
assertSame("createFighter with same id should return same object",
this.fighter, fighter2);
// System.out.println("End testSameFighters()");
|