Skip to content

Commit 07c654b

Browse files
NH-3850 - Polymorphic Linq query results aggregators failures (nhibernate#584)
* NH-3850 - Test cases for polymorphic Linq query results aggregators failures * NH-3850 - Fix for polymorphic Linq query results aggregators failures. * NH-3850 - Amending test cases for polymorphic Linq query results aggregators failures: acknowledging cases which will not be fixed.
1 parent 9f95efc commit 07c654b

19 files changed

+1800
-95
lines changed

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Linq;
1+
using System;
2+
using System.Linq;
23
using NUnit.Framework;
34

45
namespace NHibernate.Test.Linq.ByMethod
@@ -14,7 +15,10 @@ public void EmptySumDecimal()
1415
{
1516
db.OrderLines.Where(ol => false).Sum(ol => ol.Discount);
1617
},
17-
Throws.InstanceOf<HibernateException>());
18+
// Before NH-3850
19+
Throws.InstanceOf<HibernateException>()
20+
// After NH-3850
21+
.Or.InstanceOf<InvalidOperationException>());
1822
}
1923

2024
[Test]

src/NHibernate.Test/NHSpecificTest/Dates/FixtureBase.cs

-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
3232
{
3333
return false;
3434
}
35-
catch (Exception)
36-
{
37-
Assert.Fail("Probably a bug in the test case.");
38-
}
3935

4036
return true;
4137
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using System;
2+
3+
namespace NHibernate.Test.NHSpecificTest.NH3850
4+
{
5+
public abstract class DomainClassBase
6+
{
7+
public virtual int Id { get; set; }
8+
public virtual string Name { get; set; }
9+
public virtual int? Integer { get; set; }
10+
public virtual long? Long { get; set; }
11+
public virtual decimal? Decimal { get; set; }
12+
public virtual double? Double { get; set; }
13+
public virtual DateTime? DateTime { get; set; }
14+
public virtual DateTimeOffset? DateTimeOffset { get; set; }
15+
public virtual decimal NonNullableDecimal { get; set; }
16+
}
17+
18+
public class DomainClassAExtendingB : DomainClassBExtendedByA
19+
{
20+
}
21+
22+
public class DomainClassBExtendedByA : DomainClassBase
23+
{
24+
}
25+
26+
public class DomainClassCExtendedByD : DomainClassBase
27+
{
28+
}
29+
30+
public class DomainClassDExtendingC : DomainClassCExtendedByD
31+
{
32+
}
33+
34+
public class DomainClassE : DomainClassBase
35+
{
36+
}
37+
38+
public class DomainClassF : DomainClassBase
39+
{
40+
}
41+
42+
public class DomainClassGExtendedByH : DomainClassBase
43+
{
44+
}
45+
46+
public class DomainClassHExtendingG : DomainClassGExtendedByH
47+
{
48+
}
49+
}

0 commit comments

Comments
 (0)