updates unit test to ensure UmbracoContext.Current is nulled, updates dispose on application context to

not dispose the database if it is not configured.
This commit is contained in:
Shannon Deminick
2013-04-15 21:36:24 +06:00
parent 0fe8ff57a1
commit 47f6401fcd
4 changed files with 13 additions and 3 deletions

View File

@@ -282,7 +282,7 @@ namespace Umbraco.Tests.TestHelpers
get { return ApplicationContext.DatabaseContext; }
}
protected UmbracoContext GetUmbracoContext(string url, int templateId, RouteData routeData = null)
protected UmbracoContext GetUmbracoContext(string url, int templateId, RouteData routeData = null, bool setSingleton = false)
{
var cache = new PublishedContentCache();
@@ -300,6 +300,11 @@ namespace Umbraco.Tests.TestHelpers
ApplicationContext,
new PublishedCaches(cache, new PublishedMediaCache()));
if (setSingleton)
{
UmbracoContext.Current = ctx;
}
return ctx;
}