Skip to content

Commit

Permalink
tests - don't drop non-existent db in setup
Browse files Browse the repository at this point in the history
contribution from PR #33 - Svein Helge <[email protected]>

extended the contribution to cover both test classes
  • Loading branch information
timabell committed Aug 18, 2015
1 parent 8060db0 commit 29246b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion EfEnumToLookupTests/Tests/TestConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion EfEnumToLookupTests/Tests/TestStuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit 29246b5

Please sign in to comment.