Skip to content

Commit d6823ff

Browse files
committed
Cleanup tests
1 parent f6f2170 commit d6823ff

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

src/NHibernate.Test/Async/NHSpecificTest/NH3813/FixtureByCode.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,8 @@ public async Task FetchInitializesAllCollectionsAsync()
152152

153153
protected override void OnSetUp()
154154
{
155-
base.OnSetUp();
156-
157-
using (ISession s = OpenSession())
158-
using (ITransaction t = s.BeginTransaction())
155+
using (var s = OpenSession())
156+
using (var t = s.BeginTransaction())
159157
{
160158
// a record that has association records will be loaded regularly
161159
var withAssociations = new FirstTable();
@@ -180,16 +178,12 @@ protected override void OnSetUp()
180178

181179
protected override void OnTearDown()
182180
{
183-
using (ISession s = OpenSession())
184-
using (ITransaction t = s.BeginTransaction())
181+
using (var s = OpenSession())
182+
using (var t = s.BeginTransaction())
185183
{
186-
s.Delete("from AssociationTable");
187-
s.Delete("from OtherTable");
188-
s.Delete("from FirstTable");
184+
s.CreateQuery("delete from System.Object").ExecuteUpdate();
189185
t.Commit();
190186
}
191-
192-
base.OnTearDown();
193187
}
194188
}
195189
}

src/NHibernate.Test/NHSpecificTest/NH3813/FixtureByCode.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ public void FetchInitializesAllCollections()
141141

142142
protected override void OnSetUp()
143143
{
144-
base.OnSetUp();
145-
146-
using (ISession s = OpenSession())
147-
using (ITransaction t = s.BeginTransaction())
144+
using (var s = OpenSession())
145+
using (var t = s.BeginTransaction())
148146
{
149147
// a record that has association records will be loaded regularly
150148
var withAssociations = new FirstTable();
@@ -169,16 +167,12 @@ protected override void OnSetUp()
169167

170168
protected override void OnTearDown()
171169
{
172-
using (ISession s = OpenSession())
173-
using (ITransaction t = s.BeginTransaction())
170+
using (var s = OpenSession())
171+
using (var t = s.BeginTransaction())
174172
{
175-
s.Delete("from AssociationTable");
176-
s.Delete("from OtherTable");
177-
s.Delete("from FirstTable");
173+
s.CreateQuery("delete from System.Object").ExecuteUpdate();
178174
t.Commit();
179175
}
180-
181-
base.OnTearDown();
182176
}
183177
}
184178
}

0 commit comments

Comments
 (0)