Exemplo n.º 1
0
        public void Test_FailResult_At_End_Of_Input()
        {
            string input  = "this i(";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsTrue(result.Equals("s i("));
        }
Exemplo n.º 2
0
        public void Test_FailResult_SmallText()
        {
            string input  = "ab(cb";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsTrue(result.Equals("ab(cb"));
        }
Exemplo n.º 3
0
        public void Test_StartParenthesisWithoutEnd_SouldFail()
        {
            string input  = "this ( is";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsFalse(parsed);
        }
Exemplo n.º 4
0
        public void Test_StartParenthesisWithoutEnd_SouldFailResult()
        {
            string input  = "this ( is";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsTrue(result.Equals("is ( is"));
        }
Exemplo n.º 5
0
        public void AssignmentTest_ShouldFailResult()
        {
            string input  = "this ( is [ a ) text ] where the parentheses are ) incorrect.";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsTrue(result.Equals(" a ) te"));
        }
Exemplo n.º 6
0
        public void AssignmentTest_ShouldFail()
        {
            string input  = "this ( is [ a ) text ] where the parentheses are ) incorrect.";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsFalse(parsed);
        }
Exemplo n.º 7
0
        public void AssignmentTest_ShouldPass()
        {
            string input  = ":(( demo text ( [test] ( just a small ( text ( with all kind of { parentheses in {( different ( locations ) who ) then } also } with ) each other ) should ) match ) or ) not... :)";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsTrue(parsed);
        }
Exemplo n.º 8
0
        public void Test_Correct_Parentheses()
        {
            string input  = "([{}])";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsTrue(parsed);
        }
Exemplo n.º 9
0
        public void Test_No_Parentheses()
        {
            string input  = "some text";
            bool   parsed = ParenthesesParser.TryParse(input, out string result);

            Assert.IsTrue(parsed);
        }