示例#1
0
 public void IndecesTest()
 {
     string testPath = "[\"genreList\", {from: 0, to: 24}, [\"id\", \"menuName\"]";
     TokenType[] expectedTypes = new[] { TokenType.OpeningBracket, TokenType.Quote, TokenType.Token, TokenType.Quote, TokenType.CommaSeparator, TokenType.Space,
         TokenType.OpeningBrace, TokenType.Token, TokenType.Colon, TokenType.Space, TokenType.Token, TokenType.CommaSeparator, TokenType.Space, TokenType.Token, TokenType.Colon, TokenType.Space, TokenType.Token, TokenType.ClosingBrace,
         TokenType.CommaSeparator, TokenType.Space, TokenType.OpeningBracket, TokenType.Quote, TokenType.Token, TokenType.Quote, TokenType.CommaSeparator, TokenType.Space, TokenType.Quote,
         TokenType.Token, TokenType.Quote, TokenType.ClosingBracket };
     CollectionAssert.AreEqual(expectedTypes, new Tokenizer(testPath).Select(x => x.Type).ToList());
 }
示例#2
0
 public void SimpleKeyStringTest()
 {
     string testPath = "one.two.three";
     TokenType[] expectedTypes = new [] { TokenType.Token, TokenType.DotSeparator, TokenType.Token, TokenType.DotSeparator, TokenType.Token };
     CollectionAssert.AreEqual(expectedTypes, new Tokenizer(testPath).Select(x => x.Type).ToList());
 }