Skip to content

Commit c786f72

Browse files
committed
Removed unnecessary try-catch
1 parent f8a52b8 commit c786f72

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

SignalR_UnitTestingSupportCommon/EFSupport/DbMockAndInMemoryProvider.cs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,14 @@ public void SetUp()
7777
/// </summary>
7878
public void TearDown()
7979
{
80-
try
80+
if (_dbInMemorySqliteLazy != null && _dbInMemorySqliteLazy.IsValueCreated)
8181
{
82-
if (_dbInMemorySqliteLazy != null && _dbInMemorySqliteLazy.IsValueCreated)
83-
{
84-
DbInMemorySqlite.Dispose();
85-
}
86-
}
87-
catch (Exception)
88-
{
89-
// TODO: Add logger later
82+
DbInMemorySqlite.Dispose();
9083
}
9184

92-
try
93-
{
94-
if (_dbInMemoryInMemoryLazy != null && _dbInMemoryInMemoryLazy.IsValueCreated)
95-
{
96-
DbInMemory.Dispose();
97-
}
98-
}
99-
catch (Exception)
85+
if (_dbInMemoryInMemoryLazy != null && _dbInMemoryInMemoryLazy.IsValueCreated)
10086
{
101-
// TODO: Add logger later
87+
DbInMemory.Dispose();
10288
}
10389
}
10490

0 commit comments

Comments
 (0)