Skip to content

Commit a3bc6bb

Browse files
committed
Fix test
1 parent 89f8755 commit a3bc6bb

File tree

2 files changed

+8
-30
lines changed

2 files changed

+8
-30
lines changed

src/NHibernate.Test/Async/Linq/LinqQuerySamples.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,35 +1078,24 @@ from c in db.Customers
10781078
}
10791079

10801080
[Category("JOIN")]
1081-
[TestCase(true, Description = "This sample explictly joins two tables with a composite key and projects results from both tables.")]
1082-
[TestCase(false, Description = "This sample explictly joins two tables with a composite key and projects results from both tables.")]
1083-
public async Task DLinqJoin5dAsync(bool useCrossJoin)
1081+
[Test(Description = "This sample explictly joins two tables with a composite key and projects results from both tables.")]
1082+
public async Task DLinqJoin5dAsync()
10841083
{
1085-
if (useCrossJoin && !Dialect.SupportsCrossJoin)
1086-
{
1087-
Assert.Ignore("Dialect does not support cross join.");
1088-
}
1089-
10901084
var q =
10911085
from c in db.Customers
10921086
join o in db.Orders on
10931087
new {c.CustomerId, HasContractTitle = c.ContactTitle != null} equals
10941088
new {o.Customer.CustomerId, HasContractTitle = o.Customer.ContactTitle != null }
10951089
select new { c.ContactName, o.OrderId };
10961090

1097-
using (var substitute = SubstituteDialect())
10981091
using (var sqlSpy = new SqlLogSpy())
10991092
{
1100-
ClearQueryPlanCache();
1101-
substitute.Value.SupportsCrossJoin.Returns(useCrossJoin);
1102-
11031093
await (ObjectDumper.WriteAsync(q));
11041094

11051095
var sql = sqlSpy.GetWholeLog();
1106-
Assert.That(sql, Does.Contain(useCrossJoin ? "cross join" : "inner join"));
11071096
Assert.That(GetTotalOccurrences(sql, "left outer join"), Is.EqualTo(0));
1108-
Assert.That(GetTotalOccurrences(sql, "inner join"), Is.EqualTo(useCrossJoin ? 1 : 2));
1109-
Assert.That(GetTotalOccurrences(sql, "cross join"), Is.EqualTo(useCrossJoin ? 1 : 0));
1097+
Assert.That(GetTotalOccurrences(sql, "inner join"), Is.EqualTo(2));
1098+
Assert.That(GetTotalOccurrences(sql, "cross join"), Is.EqualTo(0));
11101099
}
11111100
}
11121101

src/NHibernate.Test/Linq/LinqQuerySamples.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,35 +1622,24 @@ from c in db.Customers
16221622
}
16231623

16241624
[Category("JOIN")]
1625-
[TestCase(true, Description = "This sample explictly joins two tables with a composite key and projects results from both tables.")]
1626-
[TestCase(false, Description = "This sample explictly joins two tables with a composite key and projects results from both tables.")]
1627-
public void DLinqJoin5d(bool useCrossJoin)
1625+
[Test(Description = "This sample explictly joins two tables with a composite key and projects results from both tables.")]
1626+
public void DLinqJoin5d()
16281627
{
1629-
if (useCrossJoin && !Dialect.SupportsCrossJoin)
1630-
{
1631-
Assert.Ignore("Dialect does not support cross join.");
1632-
}
1633-
16341628
var q =
16351629
from c in db.Customers
16361630
join o in db.Orders on
16371631
new {c.CustomerId, HasContractTitle = c.ContactTitle != null} equals
16381632
new {o.Customer.CustomerId, HasContractTitle = o.Customer.ContactTitle != null }
16391633
select new { c.ContactName, o.OrderId };
16401634

1641-
using (var substitute = SubstituteDialect())
16421635
using (var sqlSpy = new SqlLogSpy())
16431636
{
1644-
ClearQueryPlanCache();
1645-
substitute.Value.SupportsCrossJoin.Returns(useCrossJoin);
1646-
16471637
ObjectDumper.Write(q);
16481638

16491639
var sql = sqlSpy.GetWholeLog();
1650-
Assert.That(sql, Does.Contain(useCrossJoin ? "cross join" : "inner join"));
16511640
Assert.That(GetTotalOccurrences(sql, "left outer join"), Is.EqualTo(0));
1652-
Assert.That(GetTotalOccurrences(sql, "inner join"), Is.EqualTo(useCrossJoin ? 1 : 2));
1653-
Assert.That(GetTotalOccurrences(sql, "cross join"), Is.EqualTo(useCrossJoin ? 1 : 0));
1641+
Assert.That(GetTotalOccurrences(sql, "inner join"), Is.EqualTo(2));
1642+
Assert.That(GetTotalOccurrences(sql, "cross join"), Is.EqualTo(0));
16541643
}
16551644
}
16561645

0 commit comments

Comments
 (0)