示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#4
0
  @Test
  public void testBuildDeck() {
    // Arrange
    Deck d = new EnDeck();

    // Act
    d.build();

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

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

    // Assert
    assertNotEquals(null, cRec);
  }
示例#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);
  }
示例#7
0
 /** Test of printDeck method, of class Deck. */
 @Test
 public void testPrintDeck() {
   System.out.println("printDeck");
   Deck instance = new Deck();
   instance.printDeck();
 }
示例#8
0
 @Test
 public void testGetCard() {
   card = deck.getCard(0);
   assertTrue(card instanceof Card);
 }
示例#9
0
 @Test
 public void deckTest() {
   int length = deck.getDeckList().size();
   assertEquals(52, length);
 }