Ejemplo n.º 1
0
  @Test
  public void testBuildDeck() {
    Game g = new spGame();
    g.buildDeck();

    assertEquals(40, g.deck.size());
  }
Ejemplo n.º 2
0
 @Test
 public void testGameInit() {
   Game g = new Game();
   g.buildDeck();
   g.shuffle();
   assertNotEquals(2, g.deck.get(0).getValue());
 }
Ejemplo n.º 3
0
 @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());
 }
Ejemplo n.º 4
0
 @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());
 }
Ejemplo n.º 5
0
 @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());
 }
Ejemplo n.º 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());
 }
Ejemplo n.º 7
0
 @Test
 public void testGameBuildDeck() {
   Game g = new Game();
   g.buildDeck();
   assertEquals(52, g.deck.size());
 }