diff --git a/tests/MiniProfiler.Tests/Storage/SqlServerStorageTests.cs b/tests/MiniProfiler.Tests/Storage/SqlServerStorageTests.cs
index 4ca9a7fd..42632d56 100644
--- a/tests/MiniProfiler.Tests/Storage/SqlServerStorageTests.cs
+++ b/tests/MiniProfiler.Tests/Storage/SqlServerStorageTests.cs
@@ -40,7 +40,7 @@ public void Dispose()
{
if (!ShouldSkip)
{
- Storage.DropSchema();
+ Storage?.DropSchema(true);
}
}
}
diff --git a/tests/MiniProfiler.Tests/Storage/StorageBaseTest.cs b/tests/MiniProfiler.Tests/Storage/StorageBaseTest.cs
index 35093230..3830c911 100644
--- a/tests/MiniProfiler.Tests/Storage/StorageBaseTest.cs
+++ b/tests/MiniProfiler.Tests/Storage/StorageBaseTest.cs
@@ -225,15 +225,16 @@ public static void CreateSchema(this IAsyncStorage storage)
/// Drops the tables for this storage provider.
///
/// The storage to drop schema for.
- public static void DropSchema(this IAsyncStorage storage)
+ /// Drop tables with schema name.
+ public static void DropSchema(this IAsyncStorage storage, bool withSchema = false)
{
if (storage is DatabaseStorageBase dbs && storage is IDatabaseStorageConnectable dbsc)
{
using (var conn = dbsc.GetConnection())
{
- conn.Execute("Drop Table " + dbs.MiniProfilerClientTimingsTable);
- conn.Execute("Drop Table " + dbs.MiniProfilerTimingsTable);
- conn.Execute("Drop Table " + dbs.MiniProfilersTable);
+ conn.Execute($"Drop Table {(withSchema ? $"{dbs.SchemaName}" : string.Empty)}{dbs.MiniProfilerClientTimingsTable}");
+ conn.Execute($"Drop Table {(withSchema ? $"{dbs.SchemaName}" : string.Empty)}{dbs.MiniProfilerTimingsTable}");
+ conn.Execute($"Drop Table {(withSchema ? $"{dbs.SchemaName}" : string.Empty)}{dbs.MiniProfilersTable}");
}
}
}