Esempio n. 1
0
 def test_three_equals_zero_smallest(self):
     input_argument = [3, 3, 3, 0]
     with self.assertRaises(ZeroDivisionError):
         returned_result = number_calculator.calculator(input_argument)
Esempio n. 2
0
 def test_shorter_list_one_value(self):
     input_argument = [1]
     with self.assertRaises(ValueError):
         returned_result = number_calculator.calculator(input_argument)
Esempio n. 3
0
 def test_three_equals(self):
     input_argument = [3, 3, 3, 1]
     expected_result = 9
     returned_result = number_calculator.calculator(input_argument)
     self.assertEquals(expected_result, returned_result)
Esempio n. 4
0
 def test_three_equals_second_list(self):
     input_argument = [3, 3, 3, 9]
     expected_result = 1
     returned_result = number_calculator.calculator(input_argument)
     self.assertEquals(expected_result, returned_result)
Esempio n. 5
0
 def test_two_negatives(self):
     input_argument = [2, -4, -6, 8]
     expected_result = None
     returned_result = number_calculator.calculator(input_argument)
     self.assertEquals(expected_result, returned_result)
Esempio n. 6
0
 def test_with_negatives(self):
     input_argument = [-2, -4, -6, -8]
     expected_result = [-5, -2]
     returned_result = number_calculator.calculator(input_argument)
     self.assertEquals(expected_result, returned_result)
Esempio n. 7
0
 def test_get_average_of_four_second_list(self):
     input_argument = [2, 4, 6, 8]
     expected_result = [5, 8]
     returned_result = number_calculator.calculator(input_argument)
     self.assertEquals(expected_result, returned_result)
Esempio n. 8
0
 def test_get_average_of_four(self):
     input_argument = [1, 2, 3, 4]
     expected_result = [2.5, 4]
     returned_result = number_calculator.calculator(input_argument)
     self.assertEquals(expected_result, returned_result)
Esempio n. 9
0
 def test_longer_list_five_values(self):
     input_argument = [1, 2, 3, 4, 5]
     with self.assertRaises(ValueError):
         returned_result = number_calculator.calculator(input_argument)