コード例 #1
0
            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);
        }
    }
}
コード例 #2
0
            var sut = new CharacterClassLiteralCharacters(value, false);

            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);
        }

        [Test]
        public void CaseInsensitiveCharacterClassLiteralCharactersFromEscapedCharactersMatchesItsValue()