public void ExpressionHookTest()
            {
                // This is just a constant expression with the resultant array
                var q = ExpressionTreeTestUtils.CreateRequestAndGetQueryable(typeof(CustomDataContext), "/Customers").Expression;

                Assert.AreEqual(q.NodeType, ExpressionType.Constant);

                // this is a call to IQueryable.Where
                q = ExpressionTreeTestUtils.CreateRequestAndGetQueryable(typeof(CustomDataContext), "/Customers?$filter=ID eq 0").Expression;
                Assert.AreEqual(q.NodeType, ExpressionType.Call);

                XmlDocument xDoc = ExpressionTreeTestUtils.CreateRequestAndGetExpressionTreeXml(typeof(CustomDataContext), "/Customers?$filter=ID eq 0");

                UnitTestsUtil.VerifyXPaths(xDoc,
                                           "/Call[Method='Where']",
                                           "/Call/Arguments/Constant[position()=1]");

                using (TestUtil.RestoreStaticValueOnDispose(typeof(ExpressionTreeToXmlSerializer), "UseFullyQualifiedTypeNames"))
                {
                    xDoc = ExpressionTreeTestUtils.CreateRequestAndGetExpressionTreeXml(typeof(CustomDataContext), "/Customers?$filter=isof('AstoriaUnitTests.Stubs.Customer')");
                    UnitTestsUtil.VerifyXPaths(xDoc,
                                               "/Call/Arguments/Quote/Lambda/Body/TypeIs[TypeOperand='Customer']");

                    ExpressionTreeToXmlSerializer.UseFullyQualifiedTypeNames = true;
                    xDoc = ExpressionTreeTestUtils.CreateRequestAndGetExpressionTreeXml(typeof(CustomDataContext), "/Customers?$filter=isof('AstoriaUnitTests.Stubs.Customer')");
                    UnitTestsUtil.VerifyXPaths(xDoc,
                                               "/Call/Arguments/Quote/Lambda/Body/TypeIs[TypeOperand='AstoriaUnitTests.Stubs.Customer']");
                }
            }
            public void ExpressionExpandProviderHookTest()
            {
                using (TestUtil.MetadataCacheCleaner())
                    using (OpenWebDataServiceHelper.PageSizeCustomizer.Restore())
                    {
                        OpenWebDataServiceHelper.PageSizeCustomizer.Value = (config, type) =>
                        {
                            config.SetEntitySetAccessRule("*", EntitySetRights.All);
                            config.SetEntitySetPageSize("Customers", 2);
                        };

                        var expanded = ExpressionTreeTestUtils.CreateRequestAndGetQueryable(typeof(CustomDataContext), "/Customers?$expand=Orders&$orderby=ID add 1").Expression;
                        // We had to wrap for $skiptoken in this case
                        Assert.IsTrue(expanded.Type.ToString().StartsWith("System.Linq.IQueryable`1[Microsoft.OData.Service.Internal.ExpandedWrapper`3"));
                    }
            }