Skip to content

Commit

Permalink
Include tests for edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Nada-saad635 committed Dec 30, 2024
1 parent a748170 commit 9ef5cd4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions solutions/tests/test_fizz_buzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ def test_number(self):
"""returns the number as a string if it's neither a multiple of 3 nor 5."""
self.assertEqual(fizz_buzz(1), "1") # Neither multiple of 3 nor 5

def test_large_number(self):
"""Test behavior with a very large number."""
self.assertEqual(fizz_buzz(300000), "FizzBuzz") # Divisible by 3 and 5

def test_negative_fizz(self):
"""Test behavior with a negative multiple of 3."""
self.assertEqual(fizz_buzz(-9), "Fizz") # Negative multiple of 3

def test_zero(self):
"""Test behavior with zero."""
self.assertEqual(fizz_buzz(0), "FizzBuzz") # Divisible by any number

def test_none_input(self):
"""Test that fizz_buzz raises an AssertionError when input is None."""
with self.assertRaises(AssertionError):
Expand Down

0 comments on commit 9ef5cd4

Please sign in to comment.