Making the Sql Syntax Providers public and changing a few names and bits for consistency.
Adding resolver for the syntax providers and wiring it up in the boot manager.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.IO;
|
||||
@@ -64,6 +66,9 @@ namespace Umbraco.Tests.TestHelpers
|
||||
RepositoryResolver.Current = new RepositoryResolver(
|
||||
new RepositoryFactory());
|
||||
|
||||
SqlSyntaxProvidersResolver.Current = new SqlSyntaxProvidersResolver(
|
||||
new List<Type>{ typeof(MySqlSyntaxProvider), typeof(SqlCeSyntaxProvider), typeof(SqlServerSyntaxProvider) }) { CanResolveBeforeFrozen = true};
|
||||
|
||||
//Get the connectionstring settings from config
|
||||
var settings = ConfigurationManager.ConnectionStrings[Core.Configuration.GlobalSettings.UmbracoConnectionName];
|
||||
ConfigurationManager.AppSettings.Set(Core.Configuration.GlobalSettings.UmbracoConnectionName, @"datalayer=SQLCE4Umbraco.SqlCEHelper,SQLCE4Umbraco;data source=|DataDirectory|\UmbracoPetaPocoTests.sdf");
|
||||
@@ -100,14 +105,15 @@ namespace Umbraco.Tests.TestHelpers
|
||||
//reset the app context
|
||||
ApplicationContext.ApplicationCache.ClearAllCache();
|
||||
|
||||
SyntaxConfig.SqlSyntaxProvider = null;
|
||||
|
||||
SqlSyntaxContext.SqlSyntaxProvider = null;
|
||||
|
||||
//legacy API database connection close - because a unit test using PetaPoco db-layer can trigger the usage of SqlHelper we need to ensure that a possible connection is closed.
|
||||
SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
|
||||
ApplicationContext.Current = null;
|
||||
Resolution.IsFrozen = false;
|
||||
RepositoryResolver.Reset();
|
||||
SqlSyntaxProvidersResolver.Reset();
|
||||
|
||||
TestHelper.CleanContentDirectories();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user