Backporting the cachehelper and associated cache classes.

This commit is contained in:
Shannon
2013-12-16 13:19:10 +11:00
parent f11d4fbedd
commit a42b660648
32 changed files with 1034 additions and 1049 deletions

View File

@@ -53,34 +53,38 @@ namespace Umbraco.Tests.TestHelpers
public override void Initialize()
{
InitializeFirstRunFlags();
var path = TestHelper.CurrentAssemblyDirectory;
AppDomain.CurrentDomain.SetData("DataDirectory", path);
//disable cache
var cacheHelper = CacheHelper.CreateDisabledCacheHelper();
var dbFactory = new DefaultDatabaseFactory(
GetDbConnectionString(),
GetDbProviderName());
_appContext = new ApplicationContext(
//assign the db context
new DatabaseContext(dbFactory),
//assign the service context
new ServiceContext(new PetaPocoUnitOfWorkProvider(dbFactory), new FileUnitOfWorkProvider(), new PublishingStrategy()),
//disable cache
false)
{
IsReady = true
};
//assign the db context
new DatabaseContext(dbFactory),
//assign the service context
new ServiceContext(new PetaPocoUnitOfWorkProvider(dbFactory), new FileUnitOfWorkProvider(), new PublishingStrategy(), cacheHelper),
cacheHelper)
{
IsReady = true
};
base.Initialize();
DatabaseContext.Initialize(dbFactory.ProviderName, dbFactory.ConnectionString);
using (DisposableTimer.TraceDuration<BaseDatabaseFactoryTest>("init"))
{
DatabaseContext.Initialize(dbFactory.ProviderName, dbFactory.ConnectionString);
CreateSqlCeDatabase();
InitializeDatabase();
CreateSqlCeDatabase();
InitializeDatabase();
//ensure the configuration matches the current version for tests
SettingsForTests.ConfigurationStatus = UmbracoVersion.Current.ToString(3);
//ensure the configuration matches the current version for tests
SettingsForTests.ConfigurationStatus = UmbracoVersion.Current.ToString(3);
}
}
protected override void SetupApplicationContext()