diff --git a/EfEnumToLookupTests/Tests/TestConfiguration.cs b/EfEnumToLookupTests/Tests/TestConfiguration.cs index 4d4b17e..4a9aeaa 100644 --- a/EfEnumToLookupTests/Tests/TestConfiguration.cs +++ b/EfEnumToLookupTests/Tests/TestConfiguration.cs @@ -16,7 +16,10 @@ public void SetUp() // Using setup rather than teardown to make it easier to inspect the database after running a test. using (var context = new MagicContext()) { - context.Database.Delete(); + if (context.Database.Exists()) + { + context.Database.Delete(); + } } } diff --git a/EfEnumToLookupTests/Tests/TestStuff.cs b/EfEnumToLookupTests/Tests/TestStuff.cs index d8f10b0..b6393b7 100644 --- a/EfEnumToLookupTests/Tests/TestStuff.cs +++ b/EfEnumToLookupTests/Tests/TestStuff.cs @@ -19,7 +19,10 @@ public void SetUp() // Using setup rather than teardown to make it easier to inspect the database after running a test. using (var context = new MagicContext()) { - context.Database.Delete(); + if (context.Database.Exists()) + { + context.Database.Delete(); + } } Database.SetInitializer(new TestInitializer(new EnumToLookup()));