Skip to content

Commit aa2ff2a

Browse files
committed
Fixed tests for Firebird
1 parent 15192a2 commit aa2ff2a

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Orm/Xtensive.Orm.Tests/Issues/IssueJira0742_QueryPreprocessorClosureExpressionSupport.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace Xtensive.Orm.Tests.Issues
1616
public sealed class IssueJira0742_QueryPreprocessorClosureExpressionSupport
1717
{
1818
[Test]
19-
[TestCase(true, TestName = "WithClosurePreprocessor")]
20-
[TestCase(false, TestName = "WithoutClosurePreprocessor")]
19+
[TestCase(true)]
20+
[TestCase(false)]
2121
public void MainTest(bool useClosurePreprocessor)
2222
{
2323
using (var domain = BuildDomain(useClosurePreprocessor))
@@ -27,13 +27,15 @@ public void MainTest(bool useClosurePreprocessor)
2727

2828
var simpleQuery = session.Query.All<TestEntity>().Count(e => e.Id == TestMethod());
2929
Assert.That(simpleQuery, Is.EqualTo(1));
30+
session.Extensions.Clear();
3031

3132
var simpleJoin = session.Query.All<TestEntity>().Where(e => e.Id == TestMethod())
3233
.Join(session.Query.All<TestEntity>().Where(e => e.Id == TestMethod()),
3334
o => o.Id, i => i.Id, (o, i) => o)
3435
.Count();
3536
Assert.That(session.Extensions.Get(typeof(ClosureMarker)), GetSuccess());
3637
Assert.That(simpleJoin, Is.EqualTo(1));
38+
session.Extensions.Clear();
3739

3840
var query = session.Query.All<TestEntity>().Where(e => e.Id == TestMethod());
3941

@@ -43,10 +45,14 @@ public void MainTest(bool useClosurePreprocessor)
4345

4446
Assert.That(session.Extensions.Get(typeof(ClosureMarker)), GetSuccess());
4547
Assert.That(variableJoin, Is.EqualTo(1));
48+
session.Extensions.Clear();
4649

4750
var anyCount = session.Query.All<TestEntity>()
48-
.Count(e => e.Id == TestMethod() && Query.All<TestEntity>().Where(i => i.Id == TestMethod()).Any(z => z.Id == e.Id));
51+
.Count(e => e.Id == TestMethod() && session.Query.All<TestEntity>().Where(i => i.Id == TestMethod()).Any(z => z.Id == e.Id));
52+
53+
Assert.That(session.Extensions.Get(typeof(ClosureMarker)), GetSuccess());
4954
Assert.That(anyCount, Is.EqualTo(1));
55+
session.Extensions.Clear();
5056

5157
var linqCount = (from a in session.Query.All<TestEntity>().Where(e => e.Id == TestMethod())
5258
from b in session.Query.All<TestEntity>().Where(e => e.Id == TestMethod())
@@ -55,6 +61,7 @@ from b in session.Query.All<TestEntity>().Where(e => e.Id == TestMethod())
5561

5662
Assert.That(session.Extensions.Get(typeof(ClosureMarker)), GetSuccess());
5763
Assert.That(linqCount, Is.EqualTo(1));
64+
session.Extensions.Clear();
5865

5966
var anyCountFail = session.Query.All<TestEntity>()
6067
.Count(e => e.Id == TestMethod() && query.Any(z => z.Id == e.Id));
@@ -142,7 +149,7 @@ public class TestVisitor : ExpressionVisitor
142149
protected override Expression VisitMember(MemberExpression node)
143150
{
144151
if (!anyClosure) {
145-
anyClosure = node.Member.DeclaringType.IsClosure();
152+
anyClosure = node.Type != typeof(Session) && node.Member.DeclaringType.IsClosure();
146153
}
147154
return base.VisitMember(node);
148155
}

Orm/Xtensive.Orm.Tests/Storage/ClosureParametersCachingTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace Xtensive.Orm.Tests.Storage.ClosureParametersCachingTestModel
1414
{
15-
#region Entityes
15+
#region Entities
1616

1717
[HierarchyRoot]
1818
public class PaymentSplit : Entity
@@ -32,7 +32,7 @@ public class PaymentSplit : Entity
3232
[Field]
3333
public int Order { get;set; }
3434

35-
[Field(Precision = 19, Scale = 6)]
35+
[Field(Precision = 18, Scale = 6)]
3636
public decimal Amount { get; set; }
3737
}
3838

0 commit comments

Comments
 (0)