private static void AssertCharacterClassLiteralCharacters(ICharacterClassPart part,
                                                                  string expectedValue,
                                                                  bool expectedIgnoreCase)
        {
            Assert.That(part, Is.InstanceOf <CharacterClassLiteralCharacters>());
            var range = (CharacterClassLiteralCharacters)part;

            Assert.That(range.Value, Is.EqualTo(expectedValue));
            Assert.That(range.IgnoreCase, Is.EqualTo(expectedIgnoreCase));
        }
        private static void AssertCharacterClassRange(ICharacterClassPart part,
                                                      string expectedMin,
                                                      string expectedMax,
                                                      bool expectedIgnoreCase)
        {
            Assert.That(part, Is.InstanceOf <CharacterClassRange>());
            var range = (CharacterClassRange)part;

            Assert.That(range.Min, Is.EqualTo(expectedMin));
            Assert.That(range.Max, Is.EqualTo(expectedMax));
            Assert.That(range.IgnoreCase, Is.EqualTo(expectedIgnoreCase));
        }
Exemple #3
0
        private static IEnumerable <ICharacterClassPart> GetInternals(CharacterClassLiteralCharacters beginningDash,
                                                                      IEnumerable <ICharacterClassPart> internals,
                                                                      CharacterClassLiteralCharacters endDash)
        {
            if (beginningDash != null)
            {
                internals = new ICharacterClassPart[] { beginningDash }.Concat(internals);
            }

            if (endDash != null)
            {
                internals = internals.Concat(new ICharacterClassPart[] { endDash });
            }

            return(internals);
        }
 private static void AssertCharacterClassRange(ICharacterClassPart part,
                                               string expectedMin,
                                               string expectedMax,
                                               bool expectedIgnoreCase)
 {
     Assert.That(part, Is.InstanceOf<CharacterClassRange>());
     var range = (CharacterClassRange) part;
     Assert.That(range.Min, Is.EqualTo(expectedMin));
     Assert.That(range.Max, Is.EqualTo(expectedMax));
     Assert.That(range.IgnoreCase, Is.EqualTo(expectedIgnoreCase));
 }
 private static void AssertCharacterClassLiteralCharacters(ICharacterClassPart part,
                                                           string expectedValue,
                                                           bool expectedIgnoreCase)
 {
     Assert.That(part, Is.InstanceOf<CharacterClassLiteralCharacters>());
     var range = (CharacterClassLiteralCharacters) part;
     Assert.That(range.Value, Is.EqualTo(expectedValue));
     Assert.That(range.IgnoreCase, Is.EqualTo(expectedIgnoreCase));
 }
        private static IEnumerable<ICharacterClassPart> GetInternals(CharacterClassLiteralCharacters beginningDash,
                                                                     IEnumerable<ICharacterClassPart> internals,
                                                                     CharacterClassLiteralCharacters endDash)
        {
            if (beginningDash != null)
            {
                internals = new ICharacterClassPart[] { beginningDash }.Concat(internals);
            }

            if (endDash != null)
            {
                internals = internals.Concat(new ICharacterClassPart[] { endDash });
            }

            return internals;
        }