Skip to content
Snippets Groups Projects
Commit 51c9d8fe authored by iliya's avatar iliya
Browse files

feat: testing if popFromDeck throws in case of empty deck

parent 14e7df16
No related branches found
No related tags found
No related merge requests found
......@@ -17,4 +17,16 @@ public class DeckTest {
int nbCards = 32; // valid number of cards for creating a deck of cards
assertDoesNotThrow(() -> new Deck(nbCards));
}
@Test
public void poppingFromEmptyDeck() {
int nbCards = 32;
Deck deck = new Deck(nbCards);
for (int i = 0; i < nbCards; i++) {
deck.removeFromDeck();
}
assertThrows(RuntimeException.class, deck::removeFromDeck);
}
}
package hepia;
public class GameManagerTest {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment