had some strange issues with unit tests, added error checks.

This commit is contained in:
Shannon Deminick
2013-03-15 08:26:49 +04:00
parent 23146cb12a
commit 033692d7ee

View File

@@ -101,9 +101,15 @@ namespace Umbraco.Tests.TestHelpers
[TearDown]
public virtual void TearDown()
{
DatabaseContext.Database.Dispose();
//reset the app context
ApplicationContext.ApplicationCache.ClearAllCache();
if (ApplicationContext != null)
{
if (DatabaseContext != null && DatabaseContext.Database != null)
{
DatabaseContext.Database.Dispose();
}
//reset the app context
ApplicationContext.ApplicationCache.ClearAllCache();
}
SqlSyntaxContext.SqlSyntaxProvider = null;