Skip to content

Commit 1c54c9d

Browse files
committed
Regenerate async tests
1 parent 7b600de commit 1c54c9d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/NHibernate.Test/Async/Linq/ByMethod/GroupByTests.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,29 @@ public async Task GroupByComputedValueFromNestedObjectSelectAsync()
851851
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
852852
}
853853

854+
[Test(Description="GH-3076")]
855+
public async Task NestedNonAggregateGroupByAsync()
856+
{
857+
var list = await (db.OrderLines
858+
.GroupBy(x => new { x.Order.OrderId, x.Product.ProductId }) // this works fine
859+
.GroupBy(x => x.Key.ProductId) // exception: "A recognition error occurred"
860+
.ToListAsync());
861+
862+
Assert.That(list, Has.Count.EqualTo(77));
863+
}
864+
865+
[Test(Description="GH-3076")]
866+
public async Task NestedNonAggregateGroupBySelectAsync()
867+
{
868+
var list = await (db.OrderLines
869+
.GroupBy(x => new { x.Order.OrderId, x.Product.ProductId }) // this works fine
870+
.GroupBy(x => x.Key.ProductId) // exception: "A recognition error occurred"
871+
.Select(x => new { ProductId = x })
872+
.ToListAsync());
873+
874+
Assert.That(list, Has.Count.EqualTo(77));
875+
}
876+
854877
private static void CheckGrouping<TKey, TElement>(IEnumerable<IGrouping<TKey, TElement>> groupedItems, Func<TElement, TKey> groupBy)
855878
{
856879
var used = new HashSet<object>();

0 commit comments

Comments
 (0)