|
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. |
4 | 4 | // Created by: Alexey Kulakov |
5 | 5 | // Created: 2015.12.08 |
6 | 6 |
|
7 | 7 | using System.Linq; |
8 | 8 | using NUnit.Framework; |
9 | 9 | using Xtensive.Core; |
10 | 10 | using Xtensive.Orm.Configuration; |
11 | | -using Xtensive.Orm.Tests.Issues.IssueJira060x_InvalidExpressionInOrderByModel; |
| 11 | +using Xtensive.Orm.Tests.Issues.IssueJira0619_InvalidExpressionInOrderByModel; |
12 | 12 |
|
13 | | -namespace Xtensive.Orm.Tests.Issues.IssueJira060x_InvalidExpressionInOrderByModel |
| 13 | +namespace Xtensive.Orm.Tests.Issues.IssueJira0619_InvalidExpressionInOrderByModel |
14 | 14 | { |
15 | 15 | public interface IMesObject |
16 | 16 | { |
@@ -72,6 +72,14 @@ namespace Xtensive.Orm.Tests.Issues |
72 | 72 | { |
73 | 73 | public class IssueJira0619_InvalidExpressionInOrderBy : AutoBuildTest |
74 | 74 | { |
| 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 | + |
75 | 83 | [Test] |
76 | 84 | public void Test01() |
77 | 85 | { |
@@ -162,12 +170,20 @@ public void Test06() |
162 | 170 | } |
163 | 171 | } |
164 | 172 |
|
165 | | - protected override DomainConfiguration BuildConfiguration() |
| 173 | + [Test] |
| 174 | + public void Test07() |
166 | 175 | { |
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 | + } |
171 | 187 | } |
172 | 188 | } |
173 | 189 | } |
0 commit comments