def testValidInput(self: "testAnagramChecker") -> None:
        """ Test valid input for anagram checker.
        """

        # Test for correct anagrams.
        result1 = main("horse", "shore")
        self.assertEqual(result1, True, "Failed to identify anagrams!")

        # Test for incorrect anagrams.
        result2 = main("horse", "shored")
        self.assertEqual(result2, None, "Failed to identify anagrams!")

        return
Exemplo n.º 2
0
    def testValidInput(self: 'testAnagramChecker') -> None:
        ''' Test valid input for anagram checker.
        '''

        # Test for correct anagrams.
        result1 = main('horse', 'shore')
        self.assertEqual(result1, True, 'Failed to identify anagrams!')

        # Test for incorrect anagrams.
        result2 = main('horse', 'shored')
        self.assertEqual(result2, None, 'Failed to identify anagrams!')

        return
    def testInvalidInput(self: "testAnagramChecker") -> None:
        """ Test invalid input for anagram checker.
        """

        # Test for digits.
        result1 = main("horse", "shore9")
        self.assertEqual(result1, False, "Failed to identify invalid input!")

        # Test for multiple words as one.
        result2 = main("horse horse", "shore")
        self.assertEqual(result2, False, "Failed to identify invalid input!")

        # Test for spacing and empty lines.
        result3 = main("    ", "")
        self.assertEqual(result3, False, "Failed to identify invalid input!")

        return
Exemplo n.º 4
0
    def testInvalidInput(self: 'testAnagramChecker') -> None:
        ''' Test invalid input for anagram checker.
        '''

        # Test for digits.
        result1 = main('horse', 'shore9')
        self.assertEqual(result1, False, 'Failed to identify invalid input!')

        # Test for multiple words as one.
        result2 = main('horse horse', 'shore')
        self.assertEqual(result2, False, 'Failed to identify invalid input!')

        # Test for spacing and empty lines.
        result3 = main('    ', '')
        self.assertEqual(result3, False, 'Failed to identify invalid input!')

        return