Skip to content

Commit 30836be

Browse files
committed
Add ordered items output for ordering issue investigation
1 parent adcddae commit 30836be

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Orm/Xtensive.Orm.Tests/Linq/OrderByTest.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,21 @@ public void OrderByAnonymous2Test()
9999
[Test]
100100
public void OrderByDescendingTest()
101101
{
102-
Require.ProviderIsNot(StorageProvider.Sqlite | StorageProvider.Firebird | StorageProvider.MySql | StorageProvider.PostgreSql, "Different ordering");
102+
Require.ProviderIsNot(StorageProvider.Sqlite | StorageProvider.Firebird | StorageProvider.MySql, "Different ordering");
103+
104+
var serverOrdered = Session.Query.All<Customer>()
105+
.OrderByDescending(c => c.Address.Country).ThenByDescending(c => c.CustomerId)
106+
.Select(c => new { c.Address.Country, c.CustomerId, c.Address.City }).ToList();
107+
108+
var localOrdered = Customers
109+
.OrderByDescending(c => c.Address.Country).ThenByDescending(c => c.CustomerId)
110+
.Select(c => new { c.Address.Country, c.CustomerId, c.Address.City }).ToList();
111+
112+
for(var i = 0; i < serverOrdered.Count; i++) {
113+
var server = serverOrdered[i];
114+
var local = localOrdered[i];
115+
Console.WriteLine($"({server.Country}, {server.CustomerId}, {server.City}) - ({local.Country}, {local.CustomerId}, {local.City});");
116+
}
103117

104118
var result = Session.Query.All<Customer>()
105119
.OrderByDescending(c => c.Address.Country).ThenByDescending(c => c.CustomerId)
@@ -117,7 +131,7 @@ public void OrderByDescendingTest()
117131
[Test]
118132
public void OrderByDescendingAlternativeTest()
119133
{
120-
Require.ProviderIs(StorageProvider.Sqlite | StorageProvider.Firebird | StorageProvider.MySql | StorageProvider.PostgreSql, "Different ordering");
134+
Require.ProviderIs(StorageProvider.Sqlite | StorageProvider.Firebird | StorageProvider.MySql, "Different ordering");
121135

122136
var result = Session.Query.All<Customer>()
123137
.Where(c => !c.Address.Country.StartsWith("U"))

0 commit comments

Comments
 (0)