public void DistanceGeometryPropagatesNull()
        {
            this.implementation.callback = (methodName, arguments) =>
            {
                Assert.True(false, "shouldn't call the implementation");
            };
            var result = GeometryOperationsExtensions.Distance(null, geomPoints[0]);

            Assert.Null(result);

            result = GeometryOperationsExtensions.Distance(geomPoints[0], null);
            Assert.Null(result);
        }
 public void OrderBySpatialFunctionWithNulls()
 {
     RunSpatialExpressionTest("$orderby", "geo.distance(cast(null, 'Edm.GeometryPoint'), cast(null, 'Edm.GeometryPoint')) asc", q => q.OrderBy(element => GeometryOperationsExtensions.Distance(null, null)));
     RunSpatialExpressionTest("$orderby", "geo.distance(Point, null) asc", q => q.OrderBy(element => GeographyOperationsExtensions.Distance(element.Point, null)));
     RunSpatialExpressionTest("$orderby", "geo.distance(null, Point) asc", q => q.OrderBy(element => GeographyOperationsExtensions.Distance(null, element.Point)));
 }
 public void FilterBySpatialFunctionWithNulls()
 {
     // The extra object cast is to mimic the product behavior. We've got literals that linq to objects is
     // explicitly converting to Nullable<double>. So I force an explicit cast in the URL. But the product
     // then introduces two convert nodes. So we force a double cast in the Linq to objects to match.
     RunSpatialExpressionTest("$filter", "geo.distance(cast(null, 'Edm.GeometryPoint'), cast(null,'Edm.GeometryPoint')) gt cast(0, 'Edm.Double')", q => q.Where(it => GeometryOperationsExtensions.Distance(null, null) > (double?)(object)0));
     RunSpatialExpressionTest("$filter", "geo.distance(Point, null) gt cast(0, 'Edm.Double')", q => q.Where(it => GeographyOperationsExtensions.Distance(it.Point, null) > (double?)(object)0));
     RunSpatialExpressionTest("$filter", "geo.distance(null, Point) gt cast(0, 'Edm.Double')", q => q.Where(it => GeographyOperationsExtensions.Distance(null, it.Point) > (double?)(object)0));
 }