Skip to content

Commit a21ebcf

Browse files
committed
Linq/ByMethod/GroupByTests.cs: Add failing test case for NH-3446.
1 parent 52b0112 commit a21ebcf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,5 +501,24 @@ public override int GetHashCode()
501501
return Item1.GetHashCode() ^ Item2.GetHashCode();
502502
}
503503
}
504+
505+
506+
[Test(Description = "NH-3446"), KnownBug("NH-3446", "NHibernate.HibernateException")]
507+
public void GroupByOrderByKeySelectToClass()
508+
{
509+
db.Products.GroupBy(x => x.Supplier.CompanyName)
510+
.OrderBy(x => x.Key)
511+
.Select(x => new GroupInfo {Key = x.Key, ItemCount = x.Count(), HasSubgroups = false, Items = x})
512+
.ToList();
513+
}
514+
515+
516+
private class GroupInfo
517+
{
518+
public object Key { get; set; }
519+
public int ItemCount { get; set; }
520+
public bool HasSubgroups { get; set; }
521+
public IEnumerable Items { get; set; }
522+
}
504523
}
505524
}

0 commit comments

Comments
 (0)