Skip to content
Snippets Groups Projects
Commit 14e7df16 authored by iliya's avatar iliya
Browse files

feat: added DeckTest class

parent ae33a1bf
No related branches found
No related tags found
No related merge requests found
package hepia; package hepia;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
public class DeckTest { public class DeckTest {
@Test
public void invalidDeckCreation() {
int nbCards = 5; // invalid number of cards for creating a deck of cards
assertThrows(RuntimeException.class, () -> new Deck(5));
}
@Test
public void validDeckCreation() {
int nbCards = 32; // valid number of cards for creating a deck of cards
assertDoesNotThrow(() -> new Deck(nbCards));
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment