Backport SafeCallContext, DefaultDatabaseFactory fixes from 7.6

This commit is contained in:
Stephan
2016-10-31 11:28:28 +01:00
parent c77174059d
commit 59ace3d881
5 changed files with 260 additions and 77 deletions

View File

@@ -23,6 +23,8 @@ namespace Umbraco.Tests.Persistence
[SetUp]
public void Setup()
{
SafeCallContext.Clear();
_dbContext = new DatabaseContext(
new DefaultDatabaseFactory(Core.Configuration.GlobalSettings.UmbracoConnectionName, Mock.Of<ILogger>()),
Mock.Of<ILogger>(), new SqlCeSyntaxProvider(), Constants.DatabaseProviders.SqlCe);
@@ -34,7 +36,7 @@ namespace Umbraco.Tests.Persistence
{
DatabaseContext = _dbContext,
IsReady = true
};
};
}
[TearDown]
@@ -99,7 +101,7 @@ namespace Umbraco.Tests.Persistence
var appCtx = new ApplicationContext(
new DatabaseContext(Mock.Of<IDatabaseFactory>(), Mock.Of<ILogger>(), Mock.Of<ISqlSyntaxProvider>(), "test"),
new ServiceContext(migrationEntryService: Mock.Of<IMigrationEntryService>()),
new ServiceContext(migrationEntryService: Mock.Of<IMigrationEntryService>()),
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));