Esempio n. 1
0
 def test_a_single_five(self):
     self.assertEqual(50, greed_instance.score([5]))
Esempio n. 2
0
 def test_too_many_dice(self):
     with self.assertRaises(ValueError):
         greed_instance.score([1, 2, 3, 4, 5, 6, 7])
Esempio n. 3
0
 def test_a_single_one(self):
     self.assertEqual(100, greed_instance.score([1]))
Esempio n. 4
0
 def test_straight(self):
     self.assertEqual(1200, greed_instance.score([1, 2, 3, 4, 5, 6]))
Esempio n. 5
0
 def test_straight_out_of_order(self):
     self.assertEqual(1200, greed_instance.score([4, 5, 6, 1, 2, 3]))
Esempio n. 6
0
 def test_six_of_a_kind(self):
     self.assertEqual(8000, greed_instance.score([1, 1, 1, 1, 1, 1]))
Esempio n. 7
0
 def test_three_pairs(self):
     self.assertEqual(800, greed_instance.score([1, 1, 2, 2, 3, 3]))
Esempio n. 8
0
 def test_triple_sixes(self):
     self.assertEqual(600, greed_instance.score([6, 6, 6]))
Esempio n. 9
0
 def test_five_of_a_kind(self):
     self.assertEqual(4000, greed_instance.score([1, 1, 1, 1, 1]))
Esempio n. 10
0
 def test_triple_fives(self):
     self.assertEqual(500, greed_instance.score([5, 5, 5]))
Esempio n. 11
0
 def test_triple_fours(self):
     self.assertEqual(400, greed_instance.score([4, 4, 4]))
Esempio n. 12
0
 def test_triple_threes(self):
     self.assertEqual(300, greed_instance.score([3, 3, 3]))
Esempio n. 13
0
 def test_triple_twos(self):
     self.assertEqual(200, greed_instance.score([2, 2, 2]))
Esempio n. 14
0
 def test_triple_ones(self):
     self.assertEqual(1000, greed_instance.score([1, 1, 1]))