protected void ApprovalVerifySearchParser(Uri resourceRoot, string queryOption) { ODataUriParser parser = this.CreateSearchUriParser(resourceRoot, queryOption); var result = parser.ParseSearch(); ApprovalVerify(QueryNodeToStringVisitor.GetTestCaseAndResultString(result, queryOption)); }
public void PathFunction() { ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/SpecialOrder/Microsoft.Test.Taupo.OData.WCFService.GetOrderRate")); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
protected void ApprovalVerifySelectAndExpandParser(Uri resourceRoot, string selectQueryOption, string expandQueryOption) { ODataUriParser parser = this.CreateSelectAndExpandUriParser(resourceRoot, selectQueryOption, expandQueryOption); var result = parser.ParseSelectAndExpand(); ApprovalVerify(QueryNodeToStringVisitor.GetTestCaseAndResultString(result, selectQueryOption, expandQueryOption)); }
public void PathPrimitiveValue() { ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/SpecialOrder/OrderDate/$value")); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
public void PathLinks() { ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/SpecialOrder/OrderDetails/$ref")); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
public void PathTypeSegmentToNavigation() { ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/SpecialPerson/Microsoft.Test.Taupo.OData.WCFService.Customer/Orders")); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
public void PathBaseSingleton() { ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/SpecialOrder")); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
public void PathAction() { ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/Boss/Microsoft.Test.Taupo.OData.WCFService.ChangeAddress")); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
public void PathActionWithParens() { ODataUriParser parserWithoutparens = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/Boss/Microsoft.Test.Taupo.OData.WCFService.ChangeAddress")); ODataUriParser parserWithparens = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/Boss/Microsoft.Test.Taupo.OData.WCFService.ChangeAddress()")); Assert.AreEqual(QueryNodeToStringVisitor.ToString(parserWithoutparens.ParsePath()), QueryNodeToStringVisitor.ToString(parserWithparens.ParsePath())); }
protected void ApprovalVerifyOrderByParser(Uri resourceRoot, string queryOption, IEdmModel model = null) { ODataUriParser parser = this.CreateOrderByUriParser(resourceRoot, queryOption, model); var result = parser.ParseOrderBy(); ApprovalVerify(QueryNodeToStringVisitor.GetTestCaseAndResultString(result, queryOption)); }
public void PathFunctionWithParens() { ODataUriParser parserWithoutparens = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/SpecialOrder/Microsoft.Test.Taupo.OData.WCFService.GetOrderRate")); ODataUriParser parserWithparens = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/SpecialOrder/Microsoft.Test.Taupo.OData.WCFService.GetOrderRate()")); Assert.AreEqual(QueryNodeToStringVisitor.ToString(parserWithoutparens.ParsePath()), QueryNodeToStringVisitor.ToString(parserWithparens.ParsePath())); }
public void PathFunctionAliasedParameterWithResolver() { ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri("http://www.potato.com/VipCustomer/Microsoft.Test.Taupo.OData.WCFService.Within(Distance=@a)?@a=100")); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
public void PathFunctionWithComplexParameters() { string inputstring = "http://www.potato.com/VipCustomer/Microsoft.Test.Taupo.OData.WCFService.Within(Location={ Street:'1 Microsoft Way', City:'Redmond', PostalCode:'98052' }, Distance=10)"; ODataUriParser parser = new ODataUriParser(model, new Uri("http://www.potato.com/"), new Uri(inputstring)); var result = parser.ParsePath(); ApprovalVerify(QueryNodeToStringVisitor.ToString(result)); }
public void SelectAll() { var selectString = "*"; ODataUriParser parser = this.CreateSelectUriParser(bossBase, selectString); var result = parser.ParseSelectAndExpand(); ApprovalVerify(QueryNodeToStringVisitor.GetTestCaseAndResultString(result, selectString, null)); }
public void SelectAction() { var selectString = "Microsoft.Test.Taupo.OData.WCFService.GetBrothers"; ODataUriParser parser = this.CreateSelectUriParser(bossBase, selectString); var result = parser.ParseSelectAndExpand(); ApprovalVerify(QueryNodeToStringVisitor.GetTestCaseAndResultString(result, selectString, null)); }
protected void TestAllInOneExtensionFilter(Uri baseUri, string filter, string origFilter, IEdmModel model = null) { this.TestExtension( this.CreateFilterUriParser(baseUri, filter, model), new AllInOneResolver() { EnableCaseInsensitive = true }, parser => parser.ParseFilter(), clause => QueryNodeToStringVisitor.GetTestCaseAndResultString(clause, origFilter), this.ApprovalVerify); }
protected void TestAllInOneExtensionSelectExpand(Uri baseUri, string select, string expand, string origSelect, string origExpand, IEdmModel model = null) { this.TestExtension( this.CreateSelectAndExpandUriParser(baseUri, select, expand, model), new AllInOneResolver() { EnableCaseInsensitive = true }, parser => parser.ParseSelectAndExpand(), clause => QueryNodeToStringVisitor.GetTestCaseAndResultString(clause, origSelect, origExpand), this.ApprovalVerify); }