@Test
  public void testBuildDeck() {
    Game g = new spGame();
    g.buildDeck();

    assertEquals(40, g.deck.size());
  }
Exemple #2
0
 @Test
 public void testGameInit() {
   Game g = new Game();
   g.buildDeck();
   g.shuffle();
   assertNotEquals(2, g.deck.get(0).getValue());
 }
 @Test
 public void testSpRemoveFunction() {
   Game g = new spGame();
   g.buildDeck();
   g.customDeal(0, 3, 6, 9);
   g.remove(2);
   assertEquals(0, g.cols.get(2).size());
 }
 @Test
 public void testSpCustomDeal() {
   Game g = new spGame();
   g.buildDeck();
   g.customDeal(0, 3, 6, 9);
   assertEquals("1Clubs", g.cols.get(0).get(0).toString());
   assertEquals("2Clubs", g.cols.get(1).get(0).toString());
   assertEquals("3Clubs", g.cols.get(2).get(0).toString());
   assertEquals("4Clubs", g.cols.get(3).get(0).toString());
 }
 @Test
 public void testSpGameStart() {
   Game g = new spGame();
   g.buildDeck();
   g.shuffle();
   g.dealFour();
   assertEquals(1, g.cols.get(0).size());
   assertEquals(1, g.cols.get(1).size());
   assertEquals(1, g.cols.get(2).size());
   assertEquals(1, g.cols.get(3).size());
 }
Exemple #6
0
 @Test
 public void testRemoveFunction() {
   Game g = new Game();
   g.buildDeck();
   g.customDeal(0, 3, 6, 9);
   g.remove(2);
   assertEquals(0, g.cols.get(2).size());
   // make sure that we did not remove from an empty column
   g.remove(2);
   assertEquals(0, g.cols.get(2).size());
 }
Exemple #7
0
 @Test
 public void testGameBuildDeck() {
   Game g = new Game();
   g.buildDeck();
   assertEquals(52, g.deck.size());
 }