Skip to content

Commit fc76758

Browse files
rjpereshazzik
authored andcommitted
Added unit test
1 parent 8aaff65 commit fc76758

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/NHibernate.Test/Linq/LinqQuerySamples.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ namespace NHibernate.Test.Linq
99
[TestFixture]
1010
public class LinqQuerySamples : LinqTestCase
1111
{
12+
[Test]
13+
public void GroupTwoQueriesAndSum()
14+
{
15+
//NH-3534
16+
var queryWithAggregation = from o1 in db.Orders
17+
from o2 in db.Orders
18+
where o1.Customer.CustomerId == o2.Customer.CustomerId && o1.OrderDate == o2.OrderDate
19+
group o1 by new { o1.Customer.CustomerId, o1.OrderDate } into g
20+
select new { CustomerId = g.Key.CustomerId, LastOrderDate = g.Max(x => x.OrderDate) };
21+
22+
var result = queryWithAggregation.ToList();
23+
24+
Assert.IsNotNull(result);
25+
Assert.IsNotEmpty(result);
26+
}
27+
1228
[Category("WHERE")]
1329
[Test(Description = "This sample uses WHERE to filter for Customers in London.")]
1430
public void DLinq1()

0 commit comments

Comments
 (0)