More tests!
This commit is contained in:
parent
85d5eeaae4
commit
8c1f842557
@ -52,10 +52,6 @@ public class HandTest {
|
||||
assertEquals(Result.FIVE_OF_A_KIND, hand.checkForWin());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void fiveOfAKindWithJoker(){}
|
||||
|
||||
@Test
|
||||
public void straightFlush() {
|
||||
deck.addCard(new Card(Suit.SPADES, Value.TWO));
|
||||
@ -68,8 +64,29 @@ public class HandTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void straightFlushWithJoker() {}
|
||||
public void straightFlushWithJoker() {
|
||||
deck.addCard(new Card(Suit.SPADES, Value.TWO));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.THREE));
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FIVE));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.SIX));
|
||||
Hand hand = new Hand(deck);
|
||||
assertEquals(Result.STRAIGHT_FLUSH, hand.checkForWin());
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.THREE));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FOUR));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FIVE));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.SIX));
|
||||
hand.newRound();
|
||||
assertEquals(Result.STRAIGHT_FLUSH, hand.checkForWin());
|
||||
deck.addCard(new Card(Suit.SPADES, Value.TWO));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.THREE));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FOUR));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FIVE));
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
hand.newRound();
|
||||
assertEquals(Result.STRAIGHT_FLUSH, hand.checkForWin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fourOfAKind() {
|
||||
@ -83,8 +100,15 @@ public class HandTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void fourOfAKindWithJoker() {}
|
||||
public void fourOfAKindWithJoker() {
|
||||
deck.addCard(new Card(Suit.SPADES, Value.TWO));
|
||||
deck.addCard(new Card(Suit.HEARTS, Value.TWO));
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
deck.addCard(new Card(Suit.CLUBS, Value.TWO));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.SIX));
|
||||
Hand hand = new Hand(deck);
|
||||
assertEquals(Result.FOUR_OF_A_KIND, hand.checkForWin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fullHouse() {
|
||||
@ -109,8 +133,15 @@ public class HandTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void flushWithJoker() {}
|
||||
public void flushWithJoker() {
|
||||
deck.addCard(new Card(Suit.SPADES, Value.TWO));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FOUR));
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.NINE));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.KING));
|
||||
Hand hand = new Hand(deck);
|
||||
assertEquals(Result.FLUSH, hand.checkForWin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void straight() {
|
||||
@ -135,8 +166,29 @@ public class HandTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void straightWithJoker() {}
|
||||
public void straightWithJoker() {
|
||||
deck.addCard(new Card(Suit.SPADES, Value.TWO));
|
||||
deck.addCard(new Card(Suit.DIAMONDS, Value.THREE));
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FIVE));
|
||||
deck.addCard(new Card(Suit.CLUBS, Value.SIX));
|
||||
Hand hand = new Hand(deck);
|
||||
assertEquals(Result.STRAIGHT, hand.checkForWin());
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
deck.addCard(new Card(Suit.DIAMONDS, Value.THREE));
|
||||
deck.addCard(new Card(Suit.HEARTS, Value.FOUR));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FIVE));
|
||||
deck.addCard(new Card(Suit.CLUBS, Value.SIX));
|
||||
hand.newRound();
|
||||
assertEquals(Result.STRAIGHT, hand.checkForWin());
|
||||
deck.addCard(new Card(Suit.SPADES, Value.TWO));
|
||||
deck.addCard(new Card(Suit.DIAMONDS, Value.THREE));
|
||||
deck.addCard(new Card(Suit.HEARTS, Value.FOUR));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FIVE));
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
hand.newRound();
|
||||
assertEquals(Result.STRAIGHT, hand.checkForWin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void threeOfAKind() {
|
||||
@ -150,8 +202,15 @@ public class HandTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void threeOfAKindWithJoker() {}
|
||||
public void threeOfAKindWithJoker() {
|
||||
deck.addCard(new Card(Suit.SPADES, Value.FOUR));
|
||||
deck.addCard(new Card(Suit.HEARTS, Value.FOUR));
|
||||
deck.addCard(new Card(Suit.JOKER, Value.JOKER));
|
||||
deck.addCard(new Card(Suit.CLUBS, Value.THREE));
|
||||
deck.addCard(new Card(Suit.SPADES, Value.ACE));
|
||||
Hand hand = new Hand(deck);
|
||||
assertEquals(Result.THREE_OF_A_KIND, hand.checkForWin());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void twoPair() {
|
||||
|
Loading…
Reference in New Issue
Block a user