Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit a64dd08

Browse files
committed
Wrap DisableColumnGuessFallback test in a finally so failing test doesn't pollute other tests
1 parent 760ac4f commit a64dd08

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

tests/ServiceStack.OrmLite.Tests/Issues/SelectIntoTests.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Linq;
1+
using System;
2+
using System.Linq;
23
using NUnit.Framework;
34
using ServiceStack.DataAnnotations;
45
using ServiceStack.Model;
@@ -29,21 +30,26 @@ public void Dont_guess_column_in_mismatched_Into_model()
2930
{
3031
OrmLiteConfig.DisableColumnGuessFallback = true;
3132

32-
using (var db = OpenDbConnection())
33+
try
3334
{
34-
db.DropAndCreateTable<DbPoco>();
35+
using (var db = OpenDbConnection())
36+
{
37+
db.DropAndCreateTable<DbPoco>();
3538

36-
db.Insert(new DbPoco { Id = "1", Other_Id = "OTHER" });
39+
db.Insert(new DbPoco { Id = "1", Other_Id = "OTHER" });
3740

38-
var row = db.Select<DTOPoco>(db.From<DbPoco>()).First();
41+
var row = db.Select<DTOPoco>(db.From<DbPoco>()).First();
3942

40-
row.PrintDump();
43+
row.PrintDump();
4144

42-
Assert.That(row._Id, Is.Null);
43-
Assert.That(row.Other_Id, Is.EqualTo("OTHER"));
45+
Assert.That(row._Id, Is.Null);
46+
Assert.That(row.Other_Id, Is.EqualTo("OTHER"));
47+
}
48+
}
49+
finally
50+
{
51+
OrmLiteConfig.DisableColumnGuessFallback = false;
4452
}
45-
46-
OrmLiteConfig.DisableColumnGuessFallback = false;
4753
}
4854
}
4955
}

0 commit comments

Comments
 (0)