reset the PluginManager (as this shouldn't really need to be done). Cleaned up all unit tests so they follow the same structure and uses this base class where necessary and eliminates a lot of duplicate code.
35 lines
976 B
C#
35 lines
976 B
C#
using NUnit.Framework;
|
|
using Umbraco.Core;
|
|
using Umbraco.Core.ObjectResolution;
|
|
using Umbraco.Core.Persistence.Mappers;
|
|
using Umbraco.Core.Persistence.SqlSyntax;
|
|
|
|
namespace Umbraco.Tests.TestHelpers
|
|
{
|
|
[TestFixture]
|
|
public abstract class BaseUsingSqlCeSyntax
|
|
{
|
|
[SetUp]
|
|
public virtual void Initialize()
|
|
{
|
|
SqlSyntaxContext.SqlSyntaxProvider = SqlCeSyntax.Provider;
|
|
PluginManager.Current = new PluginManager(false);
|
|
MappingResolver.Current = new MappingResolver(
|
|
() => PluginManager.Current.ResolveAssignedMapperTypes());
|
|
|
|
Resolution.Freeze();
|
|
SetUp();
|
|
}
|
|
|
|
public virtual void SetUp()
|
|
{}
|
|
|
|
[TearDown]
|
|
public virtual void TearDown()
|
|
{
|
|
MappingResolver.Reset();
|
|
SqlSyntaxContext.SqlSyntaxProvider = null;
|
|
PluginManager.Current = null;
|
|
}
|
|
}
|
|
} |