Exemplo n.º 1
0
 def test_two_groups_of_four_is_cheaper_than_groups_of_five_and_three(self):
     basket = [1, 1, 2, 3, 4, 4, 5, 5]
     self.assertEqual(total(basket), 5120)
     basket = [1, 1, 2, 4, 5, 3, 4, 5]
     self.assertEqual(total(basket), 5120)
     basket = [2, 3, 4, 4, 5, 5, 1, 1]
     self.assertEqual(total(basket), 5120)
Exemplo n.º 2
0
 def test_three_each_of_first_2_books_and_2_each_of_remaining_books(self):
     self.assertEqual(
         total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2]), 7520)
Exemplo n.º 3
0
 def test_four_groups_of_4_are_cheaper_than_2_groups_each_of_5_and_3(self):
     print(total([1, 1, 2, 2, 3, 3, 4, 5, 1, 1, 2, 2, 3, 3, 4, 5]))
     print('>>>>')
     self.assertEqual(
         total([1, 1, 2, 2, 3, 3, 4, 5, 1, 1, 2, 2, 3, 3, 4, 5]), 10240)
Exemplo n.º 4
0
 def test_five_different_books(self):
     results = [1, 2, 3, 4, 5]
     table = 3000
     self.assertEqual(total(results), table)
Exemplo n.º 5
0
 def test_three_different_books(self):
     results = [1, 2, 3]
     table = 2160
     self.assertEqual(total(results), table)
Exemplo n.º 6
0
 def test_empty_basket(self):
     results = []
     table = 0
     self.assertEqual(total(results), table)
Exemplo n.º 7
0
 def test_one_group_of_one_and_two_plus_three_groups_of_four_is_cheaper_than_one_group_of_each_size(
     self,
 ):
     basket = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]
     self.assertEqual(total(basket), 10000)
Exemplo n.º 8
0
 def test_check_that_groups_of_four_are_created_properly_even_when_there_are_more_groups_of_three_than_groups_of_five(
     self,
 ):
     basket = [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5]
     self.assertEqual(total(basket), 14560)
Exemplo n.º 9
0
 def test_four_different_books(self):
     self.assertEqual(total([1, 2, 3, 4]), 2560)
Exemplo n.º 10
0
 def test_three_different_books(self):
     self.assertEqual(total([1, 2, 3]), 2160)
Exemplo n.º 11
0
 def test_two_different_books(self):
     self.assertEqual(total([1, 2]), 1520)
Exemplo n.º 12
0
 def test_empty_basket(self):
     self.assertEqual(total([]), 0)
Exemplo n.º 13
0
 def test_two_of_the_same_book(self):
     self.assertEqual(total([2, 2]), 1600)
Exemplo n.º 14
0
 def test_only_a_single_book(self):
     self.assertEqual(total([1]), 800)
Exemplo n.º 15
0
 def test_four_groups_of_4_are_cheaper_than_2_groups_each_of_5_and_3(self):
     self.assertEqual(
         total([1, 1, 2, 2, 3, 3, 4, 5, 1, 1, 2, 2, 3, 3, 4, 5]),
         10240)
Exemplo n.º 16
0
 def test_only_a_single_book(self):
     self.assertEqual(total([1]), 800)
Exemplo n.º 17
0
 def test_five_different_books(self):
     self.assertEqual(total([1, 2, 3, 4, 5]), 3000)
Exemplo n.º 18
0
 def test_one_group_of_one_and_four_is_cheaper_than_one_group_of_two_and_three(self):
     basket = [1, 1, 2, 3, 4]
     self.assertEqual(total(basket), 3360)
Exemplo n.º 19
0
 def test_two_groups_of_4_is_cheaper_than_groups_of_5_and_3(self):
     self.assertEqual(total([1, 1, 2, 3, 4, 4, 5, 5]), 5120)
Exemplo n.º 20
0
 def test_two_of_the_same_book(self):
     results = [2, 2]
     table = 1600
     self.assertEqual(total(results), table)
Exemplo n.º 21
0
 def test_group_of_4_plus_group_of_2_is_cheaper_than_2_groups_of_3(self):
     self.assertEqual(total([1, 1, 2, 2, 3, 4]), 4080)
Exemplo n.º 22
0
 def test_two_different_books(self):
     results = [1, 2]
     table = 1520
     self.assertEqual(total(results), table)
Exemplo n.º 23
0
 def test_two_each_of_first_4_books_and_1_copy_each_of_rest(self):
     self.assertEqual(total([1, 1, 2, 2, 3, 3, 4, 4, 5]), 5560)
Exemplo n.º 24
0
 def test_four_different_books(self):
     results = [1, 2, 3, 4]
     table = 2560
     self.assertEqual(total(results), table)
Exemplo n.º 25
0
 def test_two_copies_of_each_book(self):
     self.assertEqual(total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5]), 6000)
Exemplo n.º 26
0
 def test_two_groups_of_four_is_cheaper_than_group_of_five_plus_group_of_three(self):
     results = [1, 1, 2, 2, 3, 3, 4, 5]
     table = 5120
     self.assertEqual(total(results), table)
Exemplo n.º 27
0
 def test_three_copies_of_first_book_and_2_each_of_remaining(self):
     self.assertEqual(
         total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1]), 6800)