Files
Umbraco-CMS/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs
Shannon Deminick 50b05d25f5 Added BaseUmbracoApplicationTests and fixed up dispose on the ApplicationContext to ensure the db object is disposed and doesn't
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.
2013-03-13 18:31:07 +04:00

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;
}
}
}