-
Notifications
You must be signed in to change notification settings - Fork 0
/
PokerTest.java
35 lines (28 loc) · 1.21 KB
/
PokerTest.java
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
32
33
34
35
package zqq_pokergame;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class PokerTest {
@Test
public void test1() {
List<PokerCard> Black = new ArrayList<>();
List<PokerCard> White = new ArrayList<>();
Collections.addAll(Black, new PokerCard("2", "H"), new PokerCard("3", "D"), new PokerCard("5", "S"),
new PokerCard("9", "C"), new PokerCard("K", "D"));
Collections.addAll(White, new PokerCard("2", "C"), new PokerCard("3", "H"), new PokerCard("4", "S"),
new PokerCard("8", "C"), new PokerCard("A", "H"));
Assert.assertEquals(PokerRegular.of(Black, White), "White wins");
}
@Test
public void test2() {
List<PokerCard> Black = new ArrayList<>();
List<PokerCard> White = new ArrayList<>();
Collections.addAll(Black, new PokerCard("2", "H"), new PokerCard("4", "S"), new PokerCard("4", "C"),
new PokerCard("2", "D"), new PokerCard("4", "H"));
Collections.addAll(White, new PokerCard("2", "S"), new PokerCard("8", "S"), new PokerCard("A", "S"),
new PokerCard("Q", "S"), new PokerCard("3", "S"));
Assert.assertEquals(PokerRegular.of(White, Black), "Black wins");
}
}