Ejemplo n.º 1
0
        public void CaseSensitiveCharacterClassLiteralCharactersFromSimpleCharactersMatchesItsValue()
        {
            const string value = "abAB";

            var sut = new CharacterClassLiteralCharacters(value, false);

            Assert.That(sut.Value, Is.EqualTo(value));
            Assert.That(sut.Matches('a'), Is.True);
            Assert.That(sut.Matches('A'), Is.True);
            Assert.That(sut.Matches('b'), Is.True);
            Assert.That(sut.Matches('B'), Is.True);
            Assert.That(sut.Matches('e'), Is.False);
            Assert.That(sut.Matches('$'), Is.False);
        }
Ejemplo n.º 2
0
        public void CaseInsensitiveCharacterClassLiteralCharactersFromEscapedCharactersMatchesItsValue()
        {
            const string value = @"\]\^\-\\";

            var sut = new CharacterClassLiteralCharacters(value, true);

            Assert.That(sut.Value, Is.EqualTo(value));
            Assert.That(sut.Matches(']'), Is.True);
            Assert.That(sut.Matches('^'), Is.True);
            Assert.That(sut.Matches('-'), Is.True);
            Assert.That(sut.Matches('\\'), Is.True);
            Assert.That(sut.Matches('e'), Is.False);
            Assert.That(sut.Matches('$'), Is.False);
        }