Completes: U4-6104 Remove SqlSyntaxContext - quite a large refactor and cleanup since the SqlSyntaxContext was used everywhere :( haven't run tests, etc... yet but the project builds now.

This commit is contained in:
Shannon
2015-02-22 21:36:02 +01:00
parent 693384bdf6
commit 905e58e3b6
261 changed files with 2004 additions and 3669 deletions

View File

@@ -14,13 +14,22 @@ namespace Umbraco.Tests.TestHelpers
[TestFixture]
public abstract class BaseUsingSqlCeSyntax
{
private SqlCeSyntaxProvider _sqlSyntax;
protected SqlCeSyntaxProvider SqlSyntax
{
get { return _sqlSyntax ?? (_sqlSyntax = new SqlCeSyntaxProvider()); }
}
[SetUp]
public virtual void Initialize()
{
var container = new ServiceContainer();
container.Register<ISqlSyntaxProvider>(factory => SqlSyntax, new PerContainerLifetime());
container.Register<ILogger>(factory => Mock.Of<ILogger>(), new PerContainerLifetime());
container.Register<IProfiler>(factory => Mock.Of<IProfiler>(), new PerContainerLifetime());
var logger = new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>());
SqlSyntaxContext.SqlSyntaxProvider = new SqlCeSyntaxProvider();
PluginManager.Current = new PluginManager(new ActivatorServiceProvider(), new NullCacheProvider(),
logger,
false);
@@ -39,7 +48,6 @@ namespace Umbraco.Tests.TestHelpers
public virtual void TearDown()
{
MappingResolver.Reset();
SqlSyntaxContext.SqlSyntaxProvider = null;
PluginManager.Current = null;
}
}