Skip to content

Commit fa15423

Browse files
committed
Add GroupByTest with null value constant of Enum type
1 parent c241c61 commit fa15423

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Orm/Xtensive.Orm.Tests/Linq/GroupByTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,20 @@ public void GroupByBoolExpressionComplex()
10511051
Assert.AreEqual(falseResult, result.Single(i => !i.Value).Count);
10521052
Assert.AreEqual(trueResult, result.Single(i => i.Value).Count);
10531053
}
1054+
1055+
[Test]
1056+
public void GroupByEnumTernaryWithNonNullConstTest()
1057+
{
1058+
var query = Session.Query.All<Invoice>()
1059+
.GroupBy(c => c.Total < 0 ? (InvoiceStatus?) InvoiceStatus.Completed : c.Status).ToArray();
1060+
}
1061+
1062+
[Test]
1063+
public void GroupByEnumTernaryWithNullConstTest()
1064+
{
1065+
var query = Session.Query.All<Invoice>()
1066+
.GroupBy(c => c.Total < 0 ? (InvoiceStatus?) null : c.Status).ToArray();
1067+
}
10541068

10551069
private void DumpGrouping<TKey, TValue>(IQueryable<IGrouping<TKey, TValue>> result)
10561070
{

0 commit comments

Comments
 (0)