Beispiel #1
0
    def test_construct_name(self):
        """Given a beginning, middle, and end, name_builder should
        return a string that is the combination of the three strings.
        """
        expected = 'Jichael'

        beginning = 'John'
        end = 'Michael'
        actual = players.name_builder(beginning, end)

        self.assertEqual(expected, actual)
Beispiel #2
0
    def test_end_and_start_start_with_vowels(self):
        """If the end string and the start string start with vowels,
        the starting vowels of the end should be replaced with the
        starting vowels of the start.
        """
        expected = 'Emy'

        start = 'Eric'
        end = 'Amy'
        actual = players.name_builder(start, end)

        self.assertEqual(expected, actual)
Beispiel #3
0
    def test_end_starts_with_two_or_more_consonants(self):
        """If the end string starts with two or more consonants
        and the beginning string starts with at least one vowel,
        the first vowels of the beginning string should be placed
        before the first letter of the end string.
        """
        expected = 'Ejohn'

        beginning = 'Eric'
        end = 'John'
        actual = players.name_builder(beginning, end)

        self.assertEqual(expected, actual)
Beispiel #4
0
    def test_end_starts_with_two_or_more_consonants(self):
        """If the middle string starts with two or more consonants
        and the beginning string starts with at least one consonant,
        the first consonants of the middle string should be replaced
        with the first consonants of the beginning string.
        """
        expected = 'Bristopher'

        beginning = 'Brian'
        end = 'Christopher'
        actual = players.name_builder(beginning, end)

        self.assertEqual(expected, actual)
Beispiel #5
0
    def test_end_starts_with_vowel(self):
        """If the middle string starts with a vowel and the beginning
        string does not, the first character of the beginning string
        should be put in front of the middle string rather than
        replacing the first letter of the middle string.
        """
        expected = 'Meric'

        beginning = 'Michael'
        end = 'Eric'
        actual = players.name_builder(beginning, end)

        self.assertEqual(expected, actual)