Beispiel #1
0
    def test_return_fuzz_when_divisible_by_5(self):
        expected = 'buzz'

        result = fz.get_fizzbuzz(self.example1)

        for key, result_i in enumerate(result):
            value = key + 1
            if value % 5 == 0 and not value % 15 == 0:
                self.assertEqual(result_i, expected)
Beispiel #2
0
 def test_1_to_15(self):
     self.assertEqual(get_fizzbuzz(self.multiples, min_range=1, max_range=15), ['1', '2', 'Fizz', '4', 'Buzz', 'Fizz', '7', '8', 'Fizz', 'Buzz', '11', 'Fizz', '13', '14', 'FizzBuzz'])
Beispiel #3
0
 def test_1_when_1(self):
     self.assertEqual(get_fizzbuzz(self.multiples, 1), ['1'])
Beispiel #4
0
 def test_FizzBuzz_when_15(self):
     self.assertEqual(get_fizzbuzz(self.multiples, 15), ['FizzBuzz'])
Beispiel #5
0
 def test_Buzz_when_5(self):
     self.assertEqual(get_fizzbuzz(self.multiples, 5), ['Buzz'])
Beispiel #6
0
 def test_4_when_4(self):
     self.assertEqual(get_fizzbuzz(self.multiples, 4), ['4'])
Beispiel #7
0
 def test_Fizz_when_3(self):
     self.assertEqual(get_fizzbuzz(self.multiples, 3), ['Fizz'])
Beispiel #8
0
 def test_2_when_2(self):
     self.assertEqual(get_fizzbuzz(self.multiples, 2), ['2'])