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

Commit d99d25e

Browse files
committed
Fix NoSqlLoggingIssue
1 parent b8014d5 commit d99d25e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public NoSqlLoggingIssue(DialectContext context) : base(context) {}
1313
public void Does_log_SQL_Insert_for_Saves()
1414
{
1515
var sbLogFactory = new StringBuilderLogFactory();
16+
var hold = LogManager.LogFactory;
1617
OrmLiteConfig.ResetLogFactory(sbLogFactory);
1718

1819
using (var db = OpenDbConnection())
@@ -25,13 +26,14 @@ public void Does_log_SQL_Insert_for_Saves()
2526
var sql = sbLogFactory.GetLogs();
2627

2728
Assert.That(sql, Does.Contain("INSERT INTO"));
28-
OrmLiteConfig.ResetLogFactory(null);
29+
OrmLiteConfig.ResetLogFactory(hold);
2930
}
3031

3132
[Test]
3233
public void Does_log_SQL_Insert_for_Saves_with_Auto_Ids()
3334
{
3435
var sbLogFactory = new StringBuilderLogFactory();
36+
var hold = LogManager.LogFactory;
3537
OrmLiteConfig.ResetLogFactory(sbLogFactory);
3638

3739
using (var db = OpenDbConnection())
@@ -44,7 +46,7 @@ public void Does_log_SQL_Insert_for_Saves_with_Auto_Ids()
4446
var sql = sbLogFactory.GetLogs();
4547

4648
Assert.That(sql, Does.Contain("INSERT INTO"));
47-
OrmLiteConfig.ResetLogFactory(null);
49+
OrmLiteConfig.ResetLogFactory(hold);
4850
}
4951
}
5052
}

0 commit comments

Comments
 (0)