示例#1
0
        public void UseOneOrMoreClassWithSequenceOnAGivenStringReturnFalse()
        {
            var oneOrMore = new OneOrMore(new Sequence(
                                              new Character('u'),
                                              new Range('0', '9'),
                                              new Range('0', '9')));

            Assert.False(oneOrMore.Match("1u12b").Success());
        }
示例#2
0
        public void UseOneOrMoreClassWithSequenceOnAGivenStringReturnFullText()
        {
            var oneOrMore = new OneOrMore(new Sequence(
                                              new Character('u'),
                                              new Range('0', '9'),
                                              new Range('0', '9')));

            Assert.Equal("1u12b", oneOrMore.Match("1u12b").RemainingText());
        }
示例#3
0
        public void UseOneOrMoreClassWithRangeOnAGivenStringReturnRemainingText()
        {
            var oneOrMore = new OneOrMore(new Range('0', '9'));

            Assert.Equal("ab", oneOrMore.Match("123ab").RemainingText());
        }
示例#4
0
        public void UseOneOrMoreClassWithCharacterOnAGivenStringReturnFalse()
        {
            var oneOrMore = new OneOrMore(new Character('a'));

            Assert.False(oneOrMore.Match("baaab").Success());
        }
示例#5
0
        public void UseOneOrMoreClassWithCharacterOnAGivenStringReturnRemainingText()
        {
            var oneOrMore = new OneOrMore(new Character('a'));

            Assert.Equal("b", oneOrMore.Match("aaab").RemainingText());
        }