// TODO: Probably missing more simple test cases // TODO: Write interesting, complex parsing cases private ExpandTermToken ParseExpandOptions(string optionsText, int maxDepth = 100) { PathSegmentToken pathToken = new NonSystemToken("NavProp", null, null); SelectExpandOptionParser optionParser = new SelectExpandOptionParser(maxDepth) { MaxFilterDepth = 9, MaxSearchDepth = 9, MaxOrderByDepth = 9 }; return(optionParser.BuildExpandTermToken(pathToken, optionsText).ElementAt(0)); }
public void SelectTermTokenPathIsSet() { // Arrange PathSegmentToken pathToken = new NonSystemToken("SomeProp", null, null); SelectExpandOptionParser optionParser = new SelectExpandOptionParser(5); // Act SelectTermToken selectTermToken = optionParser.BuildSelectTermToken(pathToken, ""); // Assert Assert.NotNull(selectTermToken); Assert.NotNull(selectTermToken.PathToProperty); Assert.Equal("SomeProp", selectTermToken.PathToProperty.Identifier); }
public void ExpandTermTokenPathIsSet() { // Arrange PathSegmentToken pathToken = new NonSystemToken("SomeNavProp", null, null); SelectExpandOptionParser optionParser = new SelectExpandOptionParser(5); // Act IList <ExpandTermToken> expandTerms = optionParser.BuildExpandTermToken(pathToken, ""); // Assert Assert.NotNull(expandTerms); ExpandTermToken expandTerm = Assert.Single(expandTerms); expandTerm.PathToNavigationProp.ShouldBeNonSystemToken("SomeNavProp"); }