Пример #1
0
 public void FromRange(int lowerBound, int upperBound, string encoding, string s)
 {
     var enc = Encoding.GetEncoding(encoding);
     var sut = new ValueRangeLexerFactory();
     var lexer = sut.Create(lowerBound, upperBound, enc);
     using (var text = new StringTextSource(s))
     using (var scanner = new TextScanner(text))
     {
         var result = lexer.Read(scanner);
         Assert.Equal(s, result.Element.Text);
     }
 }
Пример #2
0
        public void FromRange(int lowerBound, int upperBound, string encoding, string s)
        {
            var enc   = Encoding.GetEncoding(encoding);
            var sut   = new ValueRangeLexerFactory();
            var lexer = sut.Create(lowerBound, upperBound, enc);

            using (var text = new StringTextSource(s))
                using (var scanner = new TextScanner(text))
                {
                    var result = lexer.Read(scanner);
                    Assert.Equal(s, result.Element.Text);
                }
        }