Example #1
0
 /** Test of pushCard method, of class Deck. */
 @Test
 public void testPushCard() {
   System.out.println("pushCard");
   Card C = null;
   Deck instance = new Deck();
   instance.pushCard(C);
 }
Example #2
0
 /** Test of popCard method, of class Deck. */
 @Test
 public void testPopCard() {
   System.out.println("popCard");
   Deck instance = new Deck();
   instance.fillDeck();
   Card expResult = null;
   Card result = instance.popCard();
   assert (expResult != result);
 }
Example #3
0
 @Test
 // Tests that getRandomCard() returns 52 cards in a row and then returns null when deck is empty
 public void testGetRandomCard() {
   for (int i = 0; i < 52; i++) {
     randomCard = deck.getRandomCard();
     assertTrue(randomCard instanceof Card);
   }
   nullRandomCard = deck.getRandomCard();
   assertNull(nullRandomCard);
 }
Example #4
0
  @Test
  public void testBuildDeck() {
    // Arrange
    Deck d = new EnDeck();

    // Act
    d.build();

    // Assert
    assertNotEquals(null, d.cards);
  }
Example #5
0
  @Test
  public void testDrawCardFromDeck() {
    // Arrange
    Deck d = new EnDeck();
    Card cRec = null;

    // Act
    d.build();
    cRec = d.deal();

    // Assert
    assertNotEquals(null, cRec);
  }
Example #6
0
  @Test
  public void testShuffleDeck() {
    // Arrange
    Deck unshuffled = new EnDeck();
    Deck shuffeled = new EnDeck();

    // Act
    unshuffled.build();
    shuffeled.build();
    shuffeled.shuffle();

    // Assert
    assertNotEquals(unshuffled.cards, shuffeled.cards);
  }
Example #7
0
 /** Test of printDeck method, of class Deck. */
 @Test
 public void testPrintDeck() {
   System.out.println("printDeck");
   Deck instance = new Deck();
   instance.printDeck();
 }
Example #8
0
 @Test
 public void testGetCard() {
   card = deck.getCard(0);
   assertTrue(card instanceof Card);
 }
Example #9
0
 @Test
 public void deckTest() {
   int length = deck.getDeckList().size();
   assertEquals(52, length);
 }