Fixes failing unit tests due to not resetting Resolution before resetting the actual resolver classes. Now it is automatically impllied that

when you Reset a resolver class, Resolution is un-frozen.
This commit is contained in:
Shannon Deminick
2013-02-05 03:10:01 +06:00
parent 58b3ce749e
commit b080ebf697
23 changed files with 20 additions and 38 deletions

View File

@@ -63,13 +63,14 @@ namespace Umbraco.Tests.TestHelpers
var engine = new SqlCeEngine(settings.ConnectionString);
engine.CreateDatabase();
Resolution.Freeze();
ApplicationContext.Current = new ApplicationContext(
//assign the db context
new DatabaseContext(new DefaultDatabaseFactory()),
//assign the service context
new ServiceContext(new PetaPocoUnitOfWorkProvider(), new FileUnitOfWorkProvider(), new PublishingStrategy())) { IsReady = true };
Resolution.Freeze();
//Configure the Database and Sql Syntax based on connection string set in config
DatabaseContext.Initialize();
//Create the umbraco database and its base data
@@ -90,7 +91,6 @@ namespace Umbraco.Tests.TestHelpers
SqlCeContextGuardian.CloseBackgroundConnection();
ApplicationContext.Current = null;
Resolution.Reset();
RepositoryResolver.Reset();
TestHelper.CleanContentDirectories();