Skip to content

Commit f0b3f89

Browse files
committed
Tests changes
- remove empty command - remove ordered items output, added previosly - more usages of "USA" in raw data replaced with "United States"
1 parent cacbc07 commit f0b3f89

File tree

3 files changed

+3
-38
lines changed

3 files changed

+3
-38
lines changed

Orm/Xtensive.Orm.Tests/Issues/IssueJira0786_SqlServerAggregatesProblem/MaxProcessingTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,6 @@ public void NullableDoubleFieldExpressionTest02()
30173017
var queryableResult = session.Query.All<TestEntity>().Max(i => (decimal?) i.NullableDoubleValue1 * i.NullableDecimalValue);
30183018
var enumerableResult = session.Query.All<TestEntity>().AsEnumerable().Max(i => (decimal?) i.NullableDoubleValue1 * i.NullableDecimalValue);
30193019
Assert.That(Math.Abs(queryableResult.Value - enumerableResult.Value), Is.LessThan(DoubleValueAccuracy));
3020-
;
30213020
}
30223021
}
30233022

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

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -99,48 +99,12 @@ public void OrderByAnonymous2Test()
9999
[Test]
100100
public void OrderByDescendingTest()
101101
{
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-
}
117-
118-
var result = Session.Query.All<Customer>()
119-
.OrderByDescending(c => c.Address.Country).ThenByDescending(c => c.CustomerId)
120-
.Select(c => c.Address.City)
121-
.AsEnumerable()
122-
.Where(c => c[0] != 'S').ToList();//There are Cites which cause slight deviation in order accross RDBMSs
123-
var expected = Customers
124-
.OrderByDescending(c => c.Address.Country).ThenByDescending(c => c.CustomerId)
125-
.Select(c => c.Address.City)
126-
.Where(c => c[0] != 'S');
127-
Assert.That(result, Is.Not.Empty);
128-
Assert.IsTrue(expected.SequenceEqual(result));
129-
}
130-
131-
[Test]
132-
public void OrderByDescendingAlternativeTest()
133-
{
134-
Require.ProviderIs(StorageProvider.Sqlite | StorageProvider.Firebird | StorageProvider.MySql, "Different ordering");
135-
136102
var result = Session.Query.All<Customer>()
137-
.Where(c => !c.Address.Country.StartsWith("U"))
138103
.OrderByDescending(c => c.Address.Country).ThenByDescending(c => c.CustomerId)
139104
.Select(c => c.Address.City)
140105
.AsEnumerable()
141106
.Where(c => c[0] != 'S').ToList();//There are Cites which cause slight deviation in order accross RDBMSs
142107
var expected = Customers
143-
.Where(c => !c.Address.Country.StartsWith('U'))
144108
.OrderByDescending(c => c.Address.Country).ThenByDescending(c => c.CustomerId)
145109
.Select(c => c.Address.City)
146110
.Where(c => c[0] != 'S');

Orm/Xtensive.Orm.Tests/ObjectModel/ChinookDO.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ public override void Import(Dictionary<string, object> fields, ImportContext con
181181
StreetAddress = (string) fields["BillingStreetAddress"],
182182
City = (string) fields["BillingCity"],
183183
State = (string) fields["BillingState"],
184-
Country = (string) fields["BillingCountry"],
184+
// USA and United Kingdom, depending on runtime and/or RDBMS, can be differently ordered
185+
// so not having abbreviation should resolve this issue.
186+
Country = ((string) fields["BillingCountry"]).Replace("USA", "United States", StringComparison.Ordinal),
185187
PostalCode = (string) fields["BillingPostalCode"],
186188
},
187189
Total = (decimal) fields["Total"],

0 commit comments

Comments
 (0)