Skip to content

Commit 5a5163b

Browse files
alex-kulakovDenis Kudelin
andcommitted
Add extra case for the IssueJira0619
Co-authored-by: Denis Kudelin <denis.kudelin.work@gmail.com>
1 parent 0d2f41a commit 5a5163b

1 file changed

Lines changed: 26 additions & 10 deletions

File tree

Orm/Xtensive.Orm.Tests/Issues/IssueJira0619_InvalidExpressionInOrderBy.cs

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// Copyright (C) 2015 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2015-2024 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Alexey Kulakov
55
// Created: 2015.12.08
66

77
using System.Linq;
88
using NUnit.Framework;
99
using Xtensive.Core;
1010
using Xtensive.Orm.Configuration;
11-
using Xtensive.Orm.Tests.Issues.IssueJira060x_InvalidExpressionInOrderByModel;
11+
using Xtensive.Orm.Tests.Issues.IssueJira0619_InvalidExpressionInOrderByModel;
1212

13-
namespace Xtensive.Orm.Tests.Issues.IssueJira060x_InvalidExpressionInOrderByModel
13+
namespace Xtensive.Orm.Tests.Issues.IssueJira0619_InvalidExpressionInOrderByModel
1414
{
1515
public interface IMesObject
1616
{
@@ -72,6 +72,14 @@ namespace Xtensive.Orm.Tests.Issues
7272
{
7373
public class IssueJira0619_InvalidExpressionInOrderBy : AutoBuildTest
7474
{
75+
protected override DomainConfiguration BuildConfiguration()
76+
{
77+
var configuration = base.BuildConfiguration();
78+
configuration.UpgradeMode = DomainUpgradeMode.Recreate;
79+
configuration.Types.Register(typeof(IMesObject).Assembly, typeof(IMesObject).Namespace);
80+
return configuration;
81+
}
82+
7583
[Test]
7684
public void Test01()
7785
{
@@ -162,12 +170,20 @@ public void Test06()
162170
}
163171
}
164172

165-
protected override DomainConfiguration BuildConfiguration()
173+
[Test]
174+
public void Test07()
166175
{
167-
var configuration = base.BuildConfiguration();
168-
configuration.UpgradeMode = DomainUpgradeMode.Recreate;
169-
configuration.Types.Register(typeof (IMesObject).Assembly, typeof (IMesObject).Namespace);
170-
return configuration;
176+
using (var session = Domain.OpenSession())
177+
using (var transaction = session.OpenTransaction()) {
178+
var query = session.Query.All<ProductRequirement>().Select(c => new {
179+
V0 = c.ID as object,
180+
V1 = c.TypeId as object,
181+
V2 = ((c.QuantityToGetViaInventoryAction.NormalizedValue / c.RequestedProductQuantity.NormalizedValue) >
182+
0.05m) as object
183+
}).OrderBy(el => el.V2);
184+
185+
Assert.DoesNotThrow(() => query.Run());
186+
}
171187
}
172188
}
173189
}

0 commit comments

Comments
 (0)