Refactoring usage of the DatabaseContext

This commit is contained in:
sitereactor
2012-10-30 15:20:54 -01:00
parent 137a54b193
commit 16bb9df623
3 changed files with 7 additions and 7 deletions

View File

@@ -72,7 +72,7 @@ namespace Umbraco.Tests.ContentStores
_umbracoContext = new UmbracoContext(_httpContextFactory.HttpContext,
new ApplicationContext(),
ServiceContext.Current,
DatabaseContext.Current,
new DatabaseContext(),
new DefaultRoutesCache(false));
_umbracoContext.GetXmlDelegate = () =>

View File

@@ -36,7 +36,7 @@ namespace Umbraco.Tests.TestHelpers
Resolution.Freeze();
ApplicationContext = new ApplicationContext() { IsReady = true };
ServiceContext = ServiceContext.Current;
DatabaseContext = DatabaseContext.Current;
DatabaseContext = new DatabaseContext();
//we need to clear out all currently created template files
var masterPages = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Masterpages));
@@ -58,10 +58,10 @@ namespace Umbraco.Tests.TestHelpers
var engine = new SqlCeEngine(settings.ConnectionString);
engine.CreateDatabase();
SyntaxConfig.SqlSyntaxProvider = SqlCeSyntaxProvider.Instance;
//Create the umbraco database
DatabaseFactory.Current.Database.Initialize();
//Configure the Database and Sql Syntax based on connection string set in config
DatabaseContext.Initialize();
//Create the umbraco database and its base data
DatabaseContext.Database.Initialize();
CreateTestData();
}

View File

@@ -32,7 +32,7 @@ namespace Umbraco.Tests.TestHelpers
Resolution.Freeze();
ApplicationContext = new ApplicationContext() { IsReady = true };
ServiceContext = ServiceContext.Current;
DatabaseContext = DatabaseContext.Current;
DatabaseContext = new DatabaseContext();
//we need to clear out all currently created template files
var masterPages = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Masterpages));
masterPages.GetFiles().ForEach(x => x.Delete());