Exemple #1
0
        public void TestWithNoMatchingValueByShorterExpression()
        {
            var extractor = new ValueTokenExtractor("match");

            var token = extractor.ExtractToken("mat", 0, new Context(ExpressiveOptions.None));

            Assert.IsNull(token);
        }
Exemple #2
0
        public static void TestWithNoMatchingValueByCase(ExpressiveOptions option)
        {
            var extractor = new ValueTokenExtractor("Match");

            var token = extractor.ExtractToken("match", 0, new Context(option));

            Assert.IsNull(token);
        }
Exemple #3
0
        public void TestWithMatchingValueInALargerExpression()
        {
            var extractor = new ValueTokenExtractor("match");

            var token = extractor.ExtractToken("match()", 0, new Context(ExpressiveOptions.None));

            Assert.IsNotNull(token);
            Assert.AreEqual("match", token.CurrentToken);
        }
Exemple #4
0
        public void TestWithMatchingValueIgnoringCase()
        {
            var extractor = new ValueTokenExtractor("match");

            var token = extractor.ExtractToken("MaTcH", 0, new Context(ExpressiveOptions.IgnoreCase));

            Assert.IsNotNull(token);
            Assert.AreEqual("match", token.CurrentToken);
        }
Exemple #5
0
 public void TestConstructingWithNull()
 {
     _ = new ValueTokenExtractor(null);
 }