-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeckTester.java
More file actions
31 lines (30 loc) · 1.26 KB
/
Copy pathDeckTester.java
File metadata and controls
31 lines (30 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* This is a class that tests the Deck class.
*/
public class DeckTester {
/**
* The main method in this class checks the Deck operations for consistency.
* @param args is not used.
*/
public static void main(String[] args) {
String[] arank = {"5", "10", "2"};
String[] asuit = {"Hearts", "Clubs", "Diamonds"};
int[] avalue = {3, 5, 10};
Deck adeck = new Deck(arank, asuit, avalue);
System.out.println("adeck size: " + adeck.size());
System.out.println("Expected: 9");
String[] brank = {"8", "4"};
String[] bsuit = {"Spades", "Clubs"};
int[] bvalue = {4, 6};
Deck bdeck = new Deck(brank, bsuit, bvalue);
System.out.println("is bdeck empty?: " + bdeck.isEmpty());
System.out.println("Expected: false");
String[] crank = {"7", "9", "11"};
String[] csuit = {"Hearts", "Clubs", "Diamonds"};
int[] cvalue = {7, 8, 10};
Deck cdeck = new Deck(crank, csuit, cvalue);
System.out.println("dealt card from cdeck: " + cdeck.deal());
System.out.println("cdeck size: " + cdeck.size());
System.out.println("Expected: 8");
}
}