Skip to content

Commit 454979f

Browse files
committed
NH-1192 - Ignore tests for Oracle as it does not support &, |, ^ as bitwise operators.
1 parent 366ae04 commit 454979f

File tree

1 file changed

+21
-16
lines changed
  • src/NHibernate.Test/NHSpecificTest/NH1192

1 file changed

+21
-16
lines changed

src/NHibernate.Test/NHSpecificTest/NH1192/Fixture.cs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
1+
using NHibernate.Dialect;
42
using NUnit.Framework;
53

64
namespace NHibernate.Test.NHSpecificTest.NH1192
75
{
86
[TestFixture]
9-
public class Fixture:BugTestCase
7+
public class Fixture : BugTestCase
108
{
9+
protected override bool AppliesTo(Dialect.Dialect dialect)
10+
{
11+
return !(dialect is Oracle8iDialect);
12+
}
13+
1114
protected override void OnSetUp()
1215
{
13-
using(var session=this.OpenSession())
14-
using(var tran=session.BeginTransaction())
16+
using (var session = OpenSession())
17+
using (var transaction = session.BeginTransaction())
1518
{
16-
session.Save(new ObjectA {FontType = Status.Bold|Status.Italic, Name = "Object1"});
19+
session.Save(new ObjectA { FontType = Status.Bold | Status.Italic, Name = "Object1" });
1720
session.Save(new ObjectA { FontType = Status.Italic, Name = "Object2" });
1821
session.Save(new ObjectA { FontType = Status.Underlined, Name = "Object2" });
19-
tran.Commit();
22+
transaction.Commit();
2023
}
2124
}
25+
2226
protected override void OnTearDown()
2327
{
24-
using (var session = this.OpenSession())
25-
using (var tran = session.BeginTransaction())
28+
using (var session = OpenSession())
29+
using (var transaction = session.BeginTransaction())
2630
{
2731
session.Delete("from ObjectA");
28-
tran.Commit();
32+
transaction.Commit();
2933
}
3034
}
3135

3236
[Test]
3337
public void BitwiseAndWorksCorrectly()
3438
{
35-
using (var session = this.OpenSession())
36-
using (var tran = session.BeginTransaction())
39+
using (var session = OpenSession())
40+
using (session.BeginTransaction())
3741
{
3842
var query = session.CreateQuery("from ObjectA o where (o.FontType & 1) > 0");
3943
var result = query.List();
40-
Assert.That(result,Has.Count.EqualTo(1));
44+
45+
Assert.That(result, Has.Count.EqualTo(1));
4146
query = session.CreateQuery("from ObjectA o where (o.FontType & 2) > 0");
4247
result = query.List();
4348
Assert.That(result, Has.Count.EqualTo(2));
@@ -51,8 +56,8 @@ public void BitwiseAndWorksCorrectly()
5156
[Test]
5257
public void BitwiseOrWorksCorrectly()
5358
{
54-
using (var session = this.OpenSession())
55-
using (var tran = session.BeginTransaction())
59+
using (var session = OpenSession())
60+
using (session.BeginTransaction())
5661
{
5762
var query = session.CreateQuery("from ObjectA o where (o.FontType | 2) = (1|2) ");
5863
var result = query.List();

0 commit comments

Comments
 (0)