/** 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); }
/** 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); }
@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); }
@Test public void testBuildDeck() { // Arrange Deck d = new EnDeck(); // Act d.build(); // Assert assertNotEquals(null, d.cards); }
@Test public void testDrawCardFromDeck() { // Arrange Deck d = new EnDeck(); Card cRec = null; // Act d.build(); cRec = d.deal(); // Assert assertNotEquals(null, cRec); }
@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); }
/** Test of printDeck method, of class Deck. */ @Test public void testPrintDeck() { System.out.println("printDeck"); Deck instance = new Deck(); instance.printDeck(); }
@Test public void testGetCard() { card = deck.getCard(0); assertTrue(card instanceof Card); }
@Test public void deckTest() { int length = deck.getDeckList().size(); assertEquals(52, length); }