コード例 #1
0
ファイル: starter.py プロジェクト: BeOleg/CodeGraph-for-PHP
    def test_when_input_is_string_and_offset_is_greater_than_string_length_then_return_None(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('ABCDEF', 10)
        self.assertEqual(None, response)
コード例 #2
0
ファイル: starter.py プロジェクト: BeOleg/CodeGraph-for-PHP
    def test_when_input_is_string_and_offset_is_zero_then_get_first_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('abcdef', 0)
        self.assertEqual('a', response)
コード例 #3
0
ファイル: starter.py プロジェクト: BeOleg/CodeGraph-for-PHP
    def test_when_input_is_string_and_offset_is_positive_then_get_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('ABCDEF', 2)
        self.assertEqual('C', response)
コード例 #4
0
ファイル: starter.py プロジェクト: BeOleg/CodeGraph-for-PHP
    def test_when_last_char_is_space_then_return_the_empty_space_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('content123 ', -1)
        self.assertEqual(' ', response)
コード例 #5
0
ファイル: starter.py プロジェクト: BeOleg/CodeGraph-for-PHP
    def test_when_input_is_None_then_return_None(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char(None, -1)
        self.assertEqual(None, response)
コード例 #6
0
    def test_when_input_is_string_and_offset_is_greater_than_string_length_then_return_None(
            self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('ABCDEF', 10)
        self.assertEqual(None, response)
コード例 #7
0
    def test_when_input_is_string_and_offset_is_positive_then_get_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('ABCDEF', 2)
        self.assertEqual('C', response)
コード例 #8
0
    def test_when_input_is_string_and_offset_is_zero_then_get_first_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('abcdef', 0)
        self.assertEqual('a', response)
コード例 #9
0
    def test_when_input_is_None_then_return_None(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char(None, -1)
        self.assertEqual(None, response)
コード例 #10
0
    def test_when_last_char_is_space_then_return_the_empty_space_char(self):
        fbe = FunctionBodyExtractor()

        response = fbe.get_char('content123 ', -1)
        self.assertEqual(' ', response)