Exemplo n.º 1
0
 public void RegexToStringShouldCreateConcatenationString()
 {
     var regex = new Regex(
         false,
         new RegexExpressionTerm(
             new RegexTermFactor(
                     new RegexFactor(
                         new RegexAtomCharacter(
                             new RegexCharacter('a'))),
                     new RegexTerm(
                         new RegexFactor(
                             new RegexAtomCharacter(
                                 new RegexCharacter('b')))))),
         false);
     Assert.AreEqual("ab", regex.ToString());
 }
Exemplo n.º 2
0
 public void RegexToStringShouldCreateRangeString()
 {
     var regex = new Regex(
         false,
         new RegexExpressionTerm(
             new RegexTerm(
                 new RegexFactor(
                     new RegexAtomSet(
                         new RegexSet(
                             false,
                             new RegexCharacterClass(
                                 new RegexCharacterRange(
                                     new RegexCharacterClassCharacter('a'),
                                     new RegexCharacterClassCharacter('z')))))))),
         false);
     Assert.AreEqual("[a-z]", regex.ToString());
 }