Merge with 6.0.3

This commit is contained in:
Shannon Deminick
2013-03-11 21:56:47 +06:00
101 changed files with 2140 additions and 662 deletions

View File

@@ -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");
@@ -106,14 +111,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;
RepositoryResolver.Reset();
SqlSyntaxProvidersResolver.Reset();
Resolution.Reset();
TestHelper.CleanContentDirectories();