Decoupling more things, mostly to do with the PluginManager and logging which now requires an IServiceProvider so have created a simple instance of that.

This commit is contained in:
Shannon
2015-01-16 15:47:44 +11:00
parent 8f100a7e9f
commit 1cb0cd296c
77 changed files with 1105 additions and 819 deletions

View File

@@ -1,8 +1,12 @@
using NUnit.Framework;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
using Umbraco.Core.ObjectResolution;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Profiling;
namespace Umbraco.Tests.TestHelpers
{
@@ -12,9 +16,13 @@ namespace Umbraco.Tests.TestHelpers
[SetUp]
public virtual void Initialize()
{
var logger = new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>());
SqlSyntaxContext.SqlSyntaxProvider = new SqlCeSyntaxProvider();
PluginManager.Current = new PluginManager(false);
PluginManager.Current = new PluginManager(new ActivatorServiceProvider(), new NullCacheProvider(),
logger,
false);
MappingResolver.Current = new MappingResolver(
new ActivatorServiceProvider(), logger.Logger,
() => PluginManager.Current.ResolveAssignedMapperTypes());
Resolution.Freeze();