Skip to content

Commit f76c7cd

Browse files
authored
CSHARP-1309: Added unit tests to demonstrate that strongly-typed index definitions on POCO arrays now work with LINQ3. (#1435)
1 parent e7e853d commit f76c7cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/MongoDB.Driver.Tests/IndexKeysDefinitionBuilderTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
using System;
17+
using System.Linq;
1718
using FluentAssertions;
1819
using MongoDB.Bson;
1920
using MongoDB.Bson.Serialization;
@@ -39,6 +40,7 @@ public void Ascending_Typed()
3940

4041
Assert(subject.Ascending(x => x.FirstName), "{fn: 1}");
4142
Assert(subject.Ascending("FirstName"), "{fn: 1}");
43+
Assert(subject.Ascending(user => user.Interviews.Select(job => job.Title)), "{'Interviews.Title': 1}");
4244
}
4345

4446
[Fact]
@@ -110,6 +112,7 @@ public void Descending_Typed()
110112

111113
Assert(subject.Descending(x => x.FirstName), "{fn: -1}");
112114
Assert(subject.Descending("FirstName"), "{fn: -1}");
115+
Assert(subject.Descending(user => user.Interviews.Select(job => job.Title)), "{'Interviews.Title': -1}");
113116
}
114117

115118
[Fact]

0 commit comments

Comments
 (0)