Fixes unit tests which require the ApplicationContext.Current singleton to be setup
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
UmbracoSettings.SettingsFilePath = Core.IO.IOHelper.MapPath(Core.IO.SystemDirectories.Config + Path.DirectorySeparatorChar, false);
|
||||
|
||||
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public override void TearDown()
|
||||
{
|
||||
base.TearDown();
|
||||
|
||||
|
||||
PropertyEditorValueConvertersResolver.Reset();
|
||||
PublishedContentStoreResolver.Reset();
|
||||
PublishedMediaStoreResolver.Reset();
|
||||
|
||||
@@ -51,9 +51,6 @@ namespace Umbraco.Tests.Routing
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
//the module requires that the singleton is setup
|
||||
ApplicationContext.Current = ApplicationContext;
|
||||
|
||||
//create the module
|
||||
_module = new UmbracoModule();
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace Umbraco.Tests.TestHelpers
|
||||
TestHelper.InitializeDatabase();
|
||||
Resolution.Freeze();
|
||||
ApplicationContext = new ApplicationContext() { IsReady = true };
|
||||
//init the singleton too!
|
||||
ApplicationContext.Current = ApplicationContext;
|
||||
//we need to clear out all currently created template files
|
||||
var masterPages = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Masterpages));
|
||||
masterPages.GetFiles().ForEach(x => x.Delete());
|
||||
|
||||
Reference in New Issue
Block a user