예제 #1
0
        public void TestChoiseFail(string text, string remaining)
        {
            var hex = new Choices(
                new Ranges('0', '9'),
                new Ranges('a', 'f'),
                new Ranges('A', 'F')
                );

            var match = hex.Match(text);

            Assert.False(match.Success());
            Assert.Equal(remaining, match.RemainingText());
        }
예제 #2
0
        public void TestChoiseCharacterAndRangeSuccess(string text, string remaining)
        {
            var hex = new Choices(
                new Charact('N'),
                new Ranges('0', '9'),
                new Ranges('a', 'f'),
                new Ranges('A', 'F')
                );

            var match = hex.Match(text);

            Assert.True(match.Success());
            Assert.Equal(remaining, match.RemainingText());
        }