Skip to content

Commit e0080c9

Browse files
committed
NH-1284 - Test refactored
1 parent 091fa6b commit e0080c9

File tree

1 file changed

+22
-14
lines changed
  • src/NHibernate.Test/NHSpecificTest/NH1284

1 file changed

+22
-14
lines changed

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

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,43 @@
22

33
namespace NHibernate.Test.NHSpecificTest.NH1284
44
{
5-
[TestFixture, Ignore("Not supported yet.")]
5+
[TestFixture]
66
public class Fixture : BugTestCase
77
{
8-
[Test]
9-
public void EmptyValueTypeComponent()
8+
protected override void OnSetUp()
109
{
11-
Person jimmy;
12-
using (ISession s = OpenSession())
13-
using (ITransaction tx = s.BeginTransaction())
10+
using (var s = OpenSession())
11+
using (var tx = s.BeginTransaction())
1412
{
15-
Person p = new Person("Jimmy Hendrix");
13+
var p = new Person("Jimmy Hendrix");
1614
s.Save(p);
1715
tx.Commit();
1816
}
17+
}
1918

20-
using (ISession s = OpenSession())
21-
using (ITransaction tx = s.BeginTransaction())
19+
protected override void OnTearDown()
20+
{
21+
using (var s = OpenSession())
22+
using (var tx = s.BeginTransaction())
2223
{
23-
jimmy = (Person)s.Get(typeof(Person), "Jimmy Hendrix");
24+
s.Delete("from Person");
2425
tx.Commit();
2526
}
26-
Assert.IsFalse(jimmy.Address.HasValue);
27+
}
2728

28-
using (ISession s = OpenSession())
29-
using (ITransaction tx = s.BeginTransaction())
29+
[Test, KnownBug("NH-1284")]
30+
public void EmptyValueTypeComponent()
31+
{
32+
Person jimmy;
33+
34+
using (var s = OpenSession())
35+
using (var tx = s.BeginTransaction())
3036
{
31-
s.Delete("from Person");
37+
jimmy = s.Get<Person>("Jimmy Hendrix");
3238
tx.Commit();
3339
}
40+
41+
Assert.That(jimmy.Address, Is.Null);
3442
}
3543
}
3644
}

0 commit comments

Comments
 (0)