public void TestInaccessibleMethods()
        {
            Employee[] employees = new Employee[] { new Employee { EmployeeID = 1 } };

            IQueryable<Employee> query = new Employee[0].AsQueryable().Where(p => p.EmployeeID == LocalMethod(p.EmployeeID));
            IQueryable<Employee> query2 = null;
            NotSupportedException expectedException = null;
            try
            {
                query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable());
            }
            catch (NotSupportedException e)
            {
                expectedException = e;
            }
            Assert.AreEqual(string.Format(OpenRiaServices.DomainServices.Client.Services.Resource.QuerySerialization_MethodNotAccessible, "LocalMethod", typeof(QuerySerializationTests)), expectedException.Message);

            // test an unsupported static method
            expectedException = null;
            query = new Employee[0].AsQueryable().AsQueryable().Where(p => p.EmployeeID == LocalStaticMethod(p.EmployeeID));
            try
            {
                query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable());
            }
            catch (NotSupportedException e)
            {
                expectedException = e;
            }
            Assert.AreEqual(string.Format(OpenRiaServices.DomainServices.Client.Services.Resource.QuerySerialization_MethodNotAccessible, "LocalStaticMethod", typeof(QuerySerializationTests)), expectedException.Message);
        }
        public void TestNullableMethodAccess()
        {
            Employee[] employees = new Employee[] { new Employee { EmployeeID = 1, ManagerID = 1 }, new Employee { EmployeeID = 1, ManagerID = null } };

            Assert.IsTrue(typeof(Employee).GetProperty("ManagerID").PropertyType == typeof(Nullable<int>));

            IQueryable<Employee> query = new Employee[0].AsQueryable().Where(p => p.ManagerID == 1);
            IQueryable<Employee> query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable());
            Assert.AreEqual(1, query2.Count());

            query = new Employee[0].AsQueryable().Where(p => p.ManagerID == null);
            query2 = (IQueryable<Employee>)RoundtripQuery(query, employees.AsQueryable());
            Assert.AreEqual(1, query2.Count());
        }