def test_math_mean(self): self.assertEqual(Math.mean([4, 5, None, 3]), 4) self.assertEqual(Math.mean([None]), 0) self.assertEqual(Math.mean([3, 4]), 3.5)
def test_math_sum(self): self.assertEqual(Math.sum([4, 5, None, 3]), 12) self.assertEqual(Math.sum([None]), 0) self.assertEqual(Math.sum([3.5, 4]), 7.5)
def test_max_single_value(self): data = [10] actual = Math.max(data) self.assertEqual(data[0], actual)
def test_max_multi_value_with_null(self): data = [10, 20, None, 30, 40, 50] actual = Math.max(data) self.assertEqual(50, actual)
def test_min_multi_value(self): data = [10, 20, 30, 40, 50] actual = Math.min(data) self.assertEqual(10, actual)
def test_sum_multi_value_with_null(self): data = [10, 20, None, 30, 40, 50] actual = Math.sum(data) self.assertEqual(150, actual)
def test_sum_single_value(self): data = [10] actual = Math.sum(data) self.assertEqual(data[0], actual)
def test_math_sum(self): self.assertEqual(Math.sum([4, 5, None, 3]), 12) self.assertEqual(Math.sum([None]), 0) self.assertEqual(Math.sum([3.5, 4]), 7.5)
def test_math_mean(self): self.assertEqual(Math.mean([4, 5, None, 3]), 4) self.assertEqual(Math.mean([None]), 0) self.assertEqual(Math.mean([3, 4]), 3.5)