WithinPolygon() public static method

Tests that the value of the named element is within a polygon (see $within and $polygon).
public static WithinPolygon ( string name, double points ) : QueryConditionList
name string The name of the element to test.
points double An array of points that defines the polygon (the second dimension must be of length 2).
return QueryConditionList
        public void TestWithinPolygonInvalidSecondDimension()
        {
            var points = new double[, ] {
                { 1, 2, 3 }
            };

            Assert.Throws <ArgumentOutOfRangeException>(() => Query.WithinPolygon("loc", points));
        }
        public void TestWithinPolygon()
        {
            var points = new double[, ] {
                { 1.1, 2.2 }, { 3.3, 4.4 }
            };
            var query    = Query.WithinPolygon("loc", points);
            var expected = "{ 'loc' : { '$within' : { '$polygon' : [[1.1, 2.2], [3.3, 4.4]] } } }".Replace("'", "\"");

            Assert.AreEqual(expected, query.ToJson());
        }