Exemplo n.º 1
0
        protected void ApprovalVerifySearchParser(Uri resourceRoot, string queryOption)
        {
            ODataUriParser parser = this.CreateSearchUriParser(resourceRoot, queryOption);
            var            result = parser.ParseSearch();

            ApprovalVerify(QueryNodeToStringVisitor.GetTestCaseAndResultString(result, queryOption));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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));
        }
Exemplo n.º 7
0
        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));
        }
Exemplo n.º 8
0
        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));
        }
Exemplo n.º 9
0
        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()));
        }
Exemplo n.º 10
0
        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));
        }
Exemplo n.º 11
0
        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()));
        }
Exemplo n.º 12
0
        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));
        }
Exemplo n.º 13
0
        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));
        }
Exemplo n.º 14
0
        public void SelectAll()
        {
            var            selectString = "*";
            ODataUriParser parser       = this.CreateSelectUriParser(bossBase, selectString);
            var            result       = parser.ParseSelectAndExpand();

            ApprovalVerify(QueryNodeToStringVisitor.GetTestCaseAndResultString(result, selectString, null));
        }
Exemplo n.º 15
0
        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));
        }
Exemplo n.º 16
0
 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);
 }
Exemplo n.º 17
0
 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);
 }