@@ -212,8 +212,8 @@ public void GeoIntersects_Typed()
212
212
GeoJson . Geographic ( 41 , 19 ) ,
213
213
GeoJson . Geographic ( 40 , 18 ) ) ;
214
214
215
- Assert ( subject . GeoIntersects ( x => x . Age , poly ) , "{age : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
216
- Assert ( subject . GeoIntersects ( "Age " , poly ) , "{age : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
215
+ Assert ( subject . GeoIntersects ( x => x . Location , poly ) , "{loc : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
216
+ Assert ( subject . GeoIntersects ( "Location " , poly ) , "{loc : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
217
217
}
218
218
219
219
[ Test ]
@@ -226,8 +226,8 @@ public void GeoIntersects_Typed_with_GeoJson()
226
226
GeoJson . Geographic ( 41 , 19 ) ,
227
227
GeoJson . Geographic ( 40 , 18 ) ) ;
228
228
229
- Assert ( subject . GeoIntersects ( x => x . Age , poly ) , "{age : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
230
- Assert ( subject . GeoIntersects ( "Age " , poly ) , "{age : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
229
+ Assert ( subject . GeoIntersects ( x => x . Location , poly ) , "{loc : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
230
+ Assert ( subject . GeoIntersects ( "Location " , poly ) , "{loc : {$geoIntersects: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
231
231
}
232
232
233
233
[ Test ]
@@ -254,25 +254,25 @@ public void GeoWithin_Typed()
254
254
GeoJson . Geographic ( 41 , 19 ) ,
255
255
GeoJson . Geographic ( 40 , 18 ) ) ;
256
256
257
- Assert ( subject . GeoWithin ( x => x . Age , poly ) , "{age : {$geoWithin: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
258
- Assert ( subject . GeoWithin ( "Age " , poly ) , "{age : {$geoWithin: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
257
+ Assert ( subject . GeoWithin ( x => x . Location , poly ) , "{loc : {$geoWithin: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
258
+ Assert ( subject . GeoWithin ( "Location " , poly ) , "{loc : {$geoWithin: {$geometry: {type: 'Polygon', coordinates: [[[40.0, 18.0], [40.0, 19.0], [41.0, 19.0], [40.0, 18.0]]]}}}}" ) ;
259
259
}
260
260
261
261
[ Test ]
262
262
public void GeoWithinBox ( )
263
263
{
264
264
var subject = CreateSubject < BsonDocument > ( ) ;
265
265
266
- Assert ( subject . GeoWithinBox ( "x" , 10 , 20 ) , "{x: {$geoWithin: {$box: [10.0, 20.0]}}}" ) ;
266
+ Assert ( subject . GeoWithinBox ( "x" , 10 , 20 , 30 , 40 ) , "{x: {$geoWithin: {$box: [[ 10.0, 20.0], [30.0, 40.0] ]}}}" ) ;
267
267
}
268
268
269
269
[ Test ]
270
270
public void GeoWithinBox_Typed ( )
271
271
{
272
272
var subject = CreateSubject < Person > ( ) ;
273
273
274
- Assert ( subject . GeoWithinBox ( x => x . Age , 10 , 20 ) , "{age : {$geoWithin: {$box: [10.0, 20.0]}}}" ) ;
275
- Assert ( subject . GeoWithinBox ( "Age " , 10 , 20 ) , "{age : {$geoWithin: {$box: [10.0, 20.0]}}}" ) ;
274
+ Assert ( subject . GeoWithinBox ( x => x . Location , 10 , 20 , 30 , 40 ) , "{loc : {$geoWithin: {$box: [[ 10.0, 20.0], [30.0, 40.0] ]}}}" ) ;
275
+ Assert ( subject . GeoWithinBox ( "Location " , 10 , 20 , 30 , 40 ) , "{loc : {$geoWithin: {$box: [[ 10.0, 20.0], [30.0, 40.0] ]}}}" ) ;
276
276
}
277
277
278
278
[ Test ]
@@ -288,8 +288,8 @@ public void GeoWithinCenter_Typed()
288
288
{
289
289
var subject = CreateSubject < Person > ( ) ;
290
290
291
- Assert ( subject . GeoWithinCenter ( x => x . Age , 10 , 20 , 30 ) , "{age : {$geoWithin: {$center: [[10.0, 20.0], 30.0]}}}" ) ;
292
- Assert ( subject . GeoWithinCenter ( "Age " , 10 , 20 , 30 ) , "{age : {$geoWithin: {$center: [[10.0, 20.0], 30.0]}}}" ) ;
291
+ Assert ( subject . GeoWithinCenter ( x => x . Location , 10 , 20 , 30 ) , "{loc : {$geoWithin: {$center: [[10.0, 20.0], 30.0]}}}" ) ;
292
+ Assert ( subject . GeoWithinCenter ( "Location " , 10 , 20 , 30 ) , "{loc : {$geoWithin: {$center: [[10.0, 20.0], 30.0]}}}" ) ;
293
293
}
294
294
295
295
[ Test ]
@@ -305,8 +305,8 @@ public void GeoWithinCenterSphere_Typed()
305
305
{
306
306
var subject = CreateSubject < Person > ( ) ;
307
307
308
- Assert ( subject . GeoWithinCenterSphere ( x => x . Age , 10 , 20 , 30 ) , "{age : {$geoWithin: {$centerSphere: [[10.0, 20.0], 30.0]}}}" ) ;
309
- Assert ( subject . GeoWithinCenterSphere ( "Age " , 10 , 20 , 30 ) , "{age : {$geoWithin: {$centerSphere: [[10.0, 20.0], 30.0]}}}" ) ;
308
+ Assert ( subject . GeoWithinCenterSphere ( x => x . Location , 10 , 20 , 30 ) , "{loc : {$geoWithin: {$centerSphere: [[10.0, 20.0], 30.0]}}}" ) ;
309
+ Assert ( subject . GeoWithinCenterSphere ( "Location " , 10 , 20 , 30 ) , "{loc : {$geoWithin: {$centerSphere: [[10.0, 20.0], 30.0]}}}" ) ;
310
310
}
311
311
312
312
[ Test ]
@@ -322,8 +322,8 @@ public void GeoWithinPolygon_Typed()
322
322
{
323
323
var subject = CreateSubject < Person > ( ) ;
324
324
325
- Assert ( subject . GeoWithinPolygon ( x => x . Age , new [ , ] { { 1d , 2d } , { 3d , 4d } } ) , "{age : {$geoWithin: {$polygon: [[1.0, 2.0], [3.0, 4.0]]}}}" ) ;
326
- Assert ( subject . GeoWithinPolygon ( "Age " , new [ , ] { { 1d , 2d } , { 3d , 4d } } ) , "{age : {$geoWithin: {$polygon: [[1.0, 2.0], [3.0, 4.0]]}}}" ) ;
325
+ Assert ( subject . GeoWithinPolygon ( x => x . Location , new [ , ] { { 1d , 2d } , { 3d , 4d } } ) , "{loc : {$geoWithin: {$polygon: [[1.0, 2.0], [3.0, 4.0]]}}}" ) ;
326
+ Assert ( subject . GeoWithinPolygon ( "Location " , new [ , ] { { 1d , 2d } , { 3d , 4d } } ) , "{loc : {$geoWithin: {$polygon: [[1.0, 2.0], [3.0, 4.0]]}}}" ) ;
327
327
}
328
328
329
329
[ Test ]
@@ -804,6 +804,9 @@ private class Person
804
804
805
805
[ BsonElement ( "pets" ) ]
806
806
public Pet [ ] Pets { get ; set ; }
807
+
808
+ [ BsonElement ( "loc" ) ]
809
+ public int [ ] Location { get ; set ; }
807
810
}
808
811
809
812
private class Pet
0 commit comments