def test_factorial(self): self.assertEqual(warmup.factorial(0), 1) self.assertEqual(warmup.factorial(1), 1) self.assertEqual(warmup.factorial(5), 120)
def test_factorial(self): self.assertEqual(factorial(5), 120)
def test_factorial_result_is_integer(self): factorial_result = factorial(1) self.assertTrue(isinstance(factorial_result, int))
def test_factorial_of_negative_number_should_raise_error(self): with self.assertRaises(ValueError): factorial(-2)
def test_factorial_of_five_should_be_120(self): factorial_result = factorial(5) self.assertEqual(factorial_result, 120)
def test_factorial_of_zero_should_be_one(self): factorial_result = factorial(0) self.assertEqual(factorial_result, 1)