diff --git a/src/NHibernate.Test/Async/NHSpecificTest/GH2463/Fixture.cs b/src/NHibernate.Test/Async/NHSpecificTest/GH2463/Fixture.cs
index be3772785b3..777e74491ce 100644
--- a/src/NHibernate.Test/Async/NHSpecificTest/GH2463/Fixture.cs
+++ b/src/NHibernate.Test/Async/NHSpecificTest/GH2463/Fixture.cs
@@ -9,6 +9,7 @@
using System.Linq;
+using NHibernate.Criterion;
using NHibernate.DomainModel;
using NUnit.Framework;
using NHibernate.Linq;
@@ -19,23 +20,68 @@ namespace NHibernate.Test.NHSpecificTest.GH2463
[TestFixture]
public class FixtureAsync : TestCase
{
+ protected override bool AppliesTo(Dialect.Dialect dialect)
+ {
+ return Dialect.SupportsScalarSubSelects;
+ }
+
protected override string[] Mappings
{
get { return new[] {"ABC.hbm.xml"}; }
}
+ protected override void OnSetUp()
+ {
+ using (var session = OpenSession())
+ using (var transaction = session.BeginTransaction())
+ {
+ var a = new A {Name = "A", AnotherName = "X"};
+ session.Save(a);
+
+ var b = new B {Name = "B", AnotherName = "X"};
+ session.Save(b);
+
+ transaction.Commit();
+ }
+ }
+
+ protected override void OnTearDown()
+ {
+ using (var session = OpenSession())
+ using (var transaction = session.BeginTransaction())
+ {
+ session.CreateQuery("delete from System.Object").ExecuteUpdate();
+
+ transaction.Commit();
+ }
+ }
+
+ //Also see GH-2599
[Test]
- public async Task CanJoinOnEntityWithDiscriminatorAsync()
+ public async Task CanJoinOnEntityWithDiscriminatorLinqAsync()
{
using (var s = OpenSession())
{
- await (s.Query().Join(
- s.Query(),
- a => a.Id,
- b => b.Id,
+ var list = await (s.Query().Join(
+ s.Query(),
+ a => a.AnotherName,
+ b => b.AnotherName,
(a, b) =>
new {a, b}).ToListAsync());
}
}
+
+ [Test]
+ public async Task CanJoinOnEntityWithDiscriminatorQueryOverAsync()
+ {
+ using (var s = OpenSession())
+ {
+ A a = null;
+ B b = null;
+ var list = await (s.QueryOver(() => a)
+ .JoinEntityAlias(() => b, () => a.AnotherName == b.AnotherName)
+ .Select((x) => a.AsEntity(), (x) => b.AsEntity()).ListAsync