@@ -167,7 +167,7 @@ public void Any_with_a_predicate_on_documents_itself_and_ClassEquals()
167
167
Assert (
168
168
x => x . G . Any ( g => g == c1 ) ,
169
169
1 ,
170
- "{ \" G\" : { \" $elemMatch\" : { \" Ids\" : null, \" D\" : \" Dolphin\" , \" E\" : { \" F\" : 55, \" H\" : 66, \" I\" : [\" insecure\" ] }, \" S\" : null, \" X\" : null } } }" ) ;
170
+ "{ \" G\" : { \" $elemMatch\" : { \" Ids\" : null, \" D\" : \" Dolphin\" , \" E\" : { \" F\" : 55, \" H\" : 66, \" I\" : [\" insecure\" ], \" C \" : null }, \" S\" : null, \" X\" : null, \" Y \" : null, \" Z \" : null } } }" ) ;
171
171
}
172
172
173
173
[ Fact ]
@@ -239,6 +239,79 @@ public void Any_with_a_multi_conditions_predicate_on_documents()
239
239
"{ \" G\" : { \" $elemMatch\" : { \" $or\" : [{ \" D\" : \" Don't\" }, { \" E.F\" : { \" $ne\" : 32 } }] } } }" ) ;
240
240
}
241
241
242
+ [ Fact ]
243
+ public void Any_with_advanced_nested_Anys ( )
244
+ {
245
+ Assert (
246
+ i => i . G . Any ( g => g . Y . S . Any ( s => s . Z . Any ( z => z . C . E . C . X . Any ( ) ) ) ) ,
247
+ 1 ,
248
+ "{ \" G.Y.S.Z\" : { $elemMatch : { \" C.E.C.X\" : { $ne : null, $not : { $size : 0 } } } } }" ) ;
249
+
250
+ Assert (
251
+ i => i . G . Any ( g => g . Y . S . Any ( s => s . Z . Any ( z => z . C . X . Any ( x => x . F == 4 ) ) ) ) ,
252
+ 1 ,
253
+ "{ \" G.Y.S.Z.C.X\" : { $elemMatch : { \" F\" : 4 } } }" ) ;
254
+
255
+ Assert (
256
+ i => i . G . Any ( g => g . D == "Don't" && g . S . Any ( s => s . Z . Any ( x => x . H == 0 ) ) ) ,
257
+ 1 ,
258
+ "{ G : { $elemMatch : { \" D\" : \" Don't\" , \" S.Z\" : { $elemMatch : { \" H\" : 0 } } } } }" ) ;
259
+
260
+ Assert (
261
+ i => i . G . Any ( g => g . D == "Don't" && g . Y . S . Any ( s => s . Z . Any ( x => x . H == 0 ) ) ) ,
262
+ 1 ,
263
+ "{ G : { $elemMatch : { \" D\" : \" Don't\" , \" Y.S.Z\" : { $elemMatch : { \" H\" : 0 } } } } }" ) ;
264
+
265
+ Assert (
266
+ i => i . G . Any ( g => g . D == "Don't" && g . S . Any ( s => s . E == null && s . Z . Any ( x => x . H == 0 ) ) ) ,
267
+ 1 ,
268
+ "{ G : { $elemMatch : { \" D\" : \" Don't\" , \" S\" : { $elemMatch : { \" E\" : null, \" Z\" : { $elemMatch : { \" H\" : 0 } } } } } } }" ) ;
269
+
270
+ Assert (
271
+ i => i . G . Any ( g => g . D == "Don't" && g . Y . S . Any ( s => s . E == null && s . Z . Any ( x => x . H == 0 ) ) ) ,
272
+ 1 ,
273
+ "{ G : { $elemMatch : { \" D\" : \" Don't\" , \" Y.S\" : { $elemMatch : { \" E\" : null, \" Z\" : { $elemMatch : { \" H\" : 0 } } } } } } }" ) ;
274
+
275
+ Assert (
276
+ i => i . G . Any ( g => g . D == "Don't" && g . Y . S . Any ( s => s . E == null && s . Z . Any ( z => z . C . X . Any ( x => x . F == 4 ) ) ) ) ,
277
+ 1 ,
278
+ "{ G: { $elemMatch : { \" D\" : \" Don't\" , \" Y.S\" : { $elemMatch : { \" E\" : null, \" Z.C.X\" : { $elemMatch : { \" F\" : 4 } } } } } } }" ) ;
279
+
280
+ Assert (
281
+ i => i . G . Any ( g => g . D == "Don't" && g . Y . S . Any ( s => s . E == null && s . Z . Any ( z => z . C . X . Any ( x => x . F == 4 && x . H == 0 ) ) ) ) ,
282
+ 1 ,
283
+ "{ G : { $elemMatch : { \" D\" : \" Don't\" , \" Y.S\" : { $elemMatch : { \" E\" : null, \" Z.C.X\" : { $elemMatch : { \" F\" : 4, \" H\" : 0 } } } } } } }" ) ;
284
+
285
+ Assert (
286
+ i => i . G . Any ( g => g . D == "Don't" && g . Y . S . Any ( s => s . E == null && s . Z . Any ( z => z . F == 1 && z . C . X . Any ( x => x . F == 4 && x . H == 0 ) ) ) ) ,
287
+ 1 ,
288
+ "{ G : { $elemMatch : { \" D\" : \" Don't\" , \" Y.S\" : { $elemMatch : { \" E\" : null, \" Z\" : { $elemMatch : { \" F\" : 1, \" C.X\" : { $elemMatch : { \" F\" : 4, \" H\" : 0 } } } } } } } } }" ) ;
289
+
290
+ Assert (
291
+ i => i . G . Any (
292
+ g => g . D == "Don't" &&
293
+ g . Y . S . Any ( s => s . Z . Any ( z => z . C . X . Any ( x => x . F == 4 ) ) ) &&
294
+ g . S . Any ( s => s . D == "Delilah" && s . Z . Any ( z => z . F == 1 && z . H == 0 ) ) ) ,
295
+ 1 ,
296
+ @"{ G : { $elemMatch : {
297
+ ""D"" : ""Don't"",
298
+ ""Y.S.Z.C.X"" : { $elemMatch : { ""F"" : 4 } },
299
+ ""S"" : { $elemMatch : { ""D"" : ""Delilah"", ""Z"" : { $elemMatch : { ""F"" : 1, ""H"" : 0 } } } }
300
+ } } }" ) ;
301
+
302
+ Assert (
303
+ i => i . G . Any (
304
+ g => g . D == "Don't" &&
305
+ g . Y . S . Any ( s => s . E == null && s . Z . Any ( z => z . F == 1 && z . C . X . Any ( x => x . F == 4 && x . H == 0 ) ) ) &&
306
+ g . S . Any ( s => s . D == "Delilah" && s . Z . Any ( z => z . F == 1 && z . H == 0 ) ) ) ,
307
+ 1 ,
308
+ @"{ G : { $elemMatch : {
309
+ ""D"" : ""Don't"",
310
+ ""Y.S"" : { $elemMatch : { ""E"" : null, ""Z"" : { $elemMatch : { ""F"" : 1, ""C.X"" : { $elemMatch : { ""F"" : 4, ""H"" : 0 } } } } } },
311
+ ""S"" : { $elemMatch : { ""D"" : ""Delilah"", ""Z"" : { $elemMatch : { ""F"" : 1, ""H"" : 0 } } } }
312
+ } } }" ) ;
313
+ }
314
+
242
315
[ Fact ]
243
316
public void Any_with_a_nested_Any ( )
244
317
{
@@ -635,7 +708,7 @@ public void ClassEquals()
635
708
Assert (
636
709
x => x . C == new C { D = "Dexter" } ,
637
710
0 ,
638
- "{ C : { Ids : null, D : 'Dexter', E : null, S : null, X : null } }" ) ;
711
+ "{ C : { Ids : null, D : 'Dexter', E : null, S : null, X : null, Y : null, Z : null } }" ) ;
639
712
}
640
713
641
714
[ Fact ]
@@ -644,7 +717,7 @@ public void ClassEqualsMethod()
644
717
Assert (
645
718
x => x . C . Equals ( new C { D = "Dexter" } ) ,
646
719
0 ,
647
- "{ C : { Ids : null, D : 'Dexter', E : null, S : null, X : null } }" ) ;
720
+ "{ C : { Ids : null, D : 'Dexter', E : null, S : null, X : null, Y : null, Z : null } }" ) ;
648
721
}
649
722
650
723
[ Fact ]
@@ -653,7 +726,7 @@ public void ClassNotEquals()
653
726
Assert (
654
727
x => x . C != new C { D = "Dexter" } ,
655
728
2 ,
656
- "{ C : { $ne : { Ids : null, D : 'Dexter', E : null, S : null, X : null } } }" ) ;
729
+ "{ C : { $ne : { Ids : null, D : 'Dexter', E : null, S : null, X : null, Y : null, Z : null } } }" ) ;
657
730
}
658
731
659
732
[ Fact ]
0 commit comments