Skip to content

Commit dc15aa6

Browse files
committed
Code cleanup
1 parent 9998e22 commit dc15aa6

File tree

2 files changed

+15
-34
lines changed

2 files changed

+15
-34
lines changed

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

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
using NHibernate.Criterion;
5-
using NUnit.Framework;
6-
using System.Collections;
1+
using NUnit.Framework;
2+
73
namespace NHibernate.Test.NHSpecificTest.NH2241
84
{
95
[TestFixture]
@@ -12,15 +8,14 @@ public class Fixture : BugTestCase
128
protected override void OnSetUp()
139
{
1410
using (var session = OpenSession())
11+
using (var tran = session.BeginTransaction())
1512
{
16-
using (var tran = session.BeginTransaction())
17-
{
18-
var country = new Country() { CountryCode = "SE", CountryName = "Sweden" };
19-
session.Save(country);
20-
tran.Commit();
21-
}
13+
var country = new Country {CountryCode = "SE", CountryName = "Sweden"};
14+
session.Save(country);
15+
tran.Commit();
2216
}
2317
}
18+
2419
protected override void OnTearDown()
2520
{
2621
using (var session = OpenSession())
@@ -36,16 +31,13 @@ protected override void OnTearDown()
3631
public void CanInsertUsingStatelessEvenWhenAssociatedEntityHasCacheStategy()
3732
{
3833
using (var ss = Sfi.OpenStatelessSession())
34+
using (var tx = ss.BeginTransaction())
3935
{
40-
using (var tx = ss.BeginTransaction())
41-
{
42-
var user = new User();
43-
user.Country = new Country() { CountryCode = "SE", CountryName = "Sweden" };
44-
45-
ss.Insert(user);
46-
tx.Commit();
47-
}
36+
var user = new User();
37+
user.Country = new Country {CountryCode = "SE", CountryName = "Sweden"};
4838

39+
ss.Insert(user);
40+
tx.Commit();
4941
}
5042
}
5143
}
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace NHibernate.Test.NHSpecificTest.NH2241
42
{
53
public class User
@@ -11,17 +9,8 @@ public class User
119

1210
public class Country
1311
{
14-
public virtual string CountryCode
15-
{
16-
get;
17-
set;
18-
}
19-
20-
public virtual string CountryName
21-
{
22-
get;
23-
set;
24-
}
12+
public virtual string CountryCode { get; set; }
2513

14+
public virtual string CountryName { get; set; }
2615
}
27-
}
16+
}

0 commit comments

Comments
 (0)