Пример #1
0
 def test_hasFourOfSameSuit(self):
     handOfCards = ["S2", "D3", "C6", "S9", "D9", "D6", "D8"]
     hand = Hand()
     hand.hand = handOfCards
     groupBySuit = self.winningRummy.getGroupsOfSuits(hand)
     compareHand = Hand()
     compareHand.hand = ["D3", "D4", "D6", "D8"]
     self.assertEqual(["D3", "D6", "D8", "D9"], groupBySuit[1].getHand())
Пример #2
0
 def test_hasRunofThree(self):
     handOfCards = ["C2", "D6", "CA", "H9", "D4", "D5", "SK"]
     hand = Hand()
     hand.hand = handOfCards
     handsOfRun = self.winningRummy.getRuns(hand)
     compareHand = Hand()
     compareHand.hand = ["D4", "D5", "D6"]
     self.assertEqual(["D4", "D5", "D6"], handsOfRun[1].getHand())
Пример #3
0
 def test_hasTwoGroupsOfSuitsSecond(self):
     handOfCards = ["C2", "D3", "C6", "C9", "D4", "D6", "D8"]
     hand = Hand()
     hand.hand = handOfCards
     groupBySuit = self.winningRummy.getGroupsOfSuits(hand)
     compareHandOne = Hand()
     compareHandOne = ["C2", "C6", "C9"]
     compareHandTwo = Hand()
     compareHandTwo.hand = ["D3", "D4", "D6", "D8"]
     self.assertEqual(["D3", "D4", "D6", "D8"], groupBySuit[1].getHand())
Пример #4
0
 def test_getRunsFirst(self):
     handOfCards = ["C2", "D6", "CA", "H9", "D4", "D5", "SK"]
     hand = Hand()
     hand.hand = handOfCards
     self.assertEqual(["CA", "C2"],
                      self.winningRummy.getRuns(hand)[0].getHand())
Пример #5
0
 def test_getGroupsOfSuitsFirst(self):
     handOfCards = ["S2", "C5", "C6", "S9", "D4", "D6", "D8"]
     hand = Hand()
     hand.hand = handOfCards
     self.assertEqual(["C5", "C6"],
                      self.winningRummy.getGroupsOfSuits(hand)[0].getHand())
Пример #6
0
 def test_hasNoGroupsOfSuits(self):
     handOfCards = ["C2", "H3", "C6", "H9", "D4", "D6", "S8"]
     hand = Hand()
     hand.hand = handOfCards
     score = self.winningRummy.hasRummyScore(hand)
     self.assertEqual(0, score)
Пример #7
0
 def test_hasNoRummy(self):
     handOfCards = ["C2", "D6", "CA", "H9", "D4", "D5", "D3"]
     hand = Hand()
     hand.hand = handOfCards
     self.assertFalse(self.winningRummy.hasRummy(hand, 0))
Пример #8
0
 def test_hasRummyScore(self):
     handOfCards = ["C2", "D6", "CA", "C9", "D4", "D5", "D3"]
     hand = Hand()
     hand.hand = handOfCards
     self.assertEqual(7, self.winningRummy.hasRummyScore(hand))
Пример #9
0
 def test_hasRunofFour(self):
     handOfCards = ["C2", "D6", "CA", "H9", "D4", "D5", "D3"]
     hand = Hand()
     hand.hand = handOfCards
     handsOfRun = self.winningRummy.getRuns(hand)
     self.assertEqual(["D3", "D4", "D5", "D6"], handsOfRun[1].getHand())