Skip to content

NH-3850 - Polymorphic Linq query results aggregators failures #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/NHibernate.Test/Linq/ByMethod/SumTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
using NUnit.Framework;

namespace NHibernate.Test.Linq.ByMethod
Expand All @@ -14,7 +15,10 @@ public void EmptySumDecimal()
{
db.OrderLines.Where(ol => false).Sum(ol => ol.Discount);
},
Throws.InstanceOf<HibernateException>());
// Before NH-3850
Throws.InstanceOf<HibernateException>()
// After NH-3850
.Or.InstanceOf<InvalidOperationException>());
}

[Test]
Expand Down
4 changes: 0 additions & 4 deletions src/NHibernate.Test/NHSpecificTest/Dates/FixtureBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
{
return false;
}
catch (Exception)
{
Assert.Fail("Probably a bug in the test case.");
}

return true;
}
Expand Down
49 changes: 49 additions & 0 deletions src/NHibernate.Test/NHSpecificTest/NH3850/Domain.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System;

namespace NHibernate.Test.NHSpecificTest.NH3850
{
public abstract class DomainClassBase
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual int? Integer { get; set; }
public virtual long? Long { get; set; }
public virtual decimal? Decimal { get; set; }
public virtual double? Double { get; set; }
public virtual DateTime? DateTime { get; set; }
public virtual DateTimeOffset? DateTimeOffset { get; set; }
public virtual decimal NonNullableDecimal { get; set; }
}

public class DomainClassAExtendingB : DomainClassBExtendedByA
{
}

public class DomainClassBExtendedByA : DomainClassBase
{
}

public class DomainClassCExtendedByD : DomainClassBase
{
}

public class DomainClassDExtendingC : DomainClassCExtendedByD
{
}

public class DomainClassE : DomainClassBase
{
}

public class DomainClassF : DomainClassBase
{
}

public class DomainClassGExtendedByH : DomainClassBase
{
}

public class DomainClassHExtendingG : DomainClassGExtendedByH
{
}
}
Loading