Fixing broken media tests after having added ToXml and saving of xml to ContentXml table in the MediaService

This commit is contained in:
Morten Christensen
2013-01-24 12:25:48 -01:00
parent b17dcd2b56
commit 23141e1e8c
6 changed files with 48 additions and 23 deletions

View File

@@ -13,6 +13,8 @@ using Umbraco.Core.Publishing;
using Umbraco.Core.Services;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Entities;
using umbraco.editorControls.tinyMCE3;
using umbraco.interfaces;
namespace Umbraco.Tests.Services
{
@@ -25,6 +27,20 @@ namespace Umbraco.Tests.Services
[SetUp]
public override void Initialize()
{
//NOTE The DataTypesResolver is only necessary because we are using the Save method in the MediaService
//this ensures its reset
PluginManager.Current = new PluginManager();
//for testing, we'll specify which assemblies are scanned for the PluginTypeResolver
PluginManager.Current.AssembliesToScan = new[]
{
typeof(IDataType).Assembly,
typeof(tinyMCE3dataType).Assembly
};
DataTypesResolver.Current = new DataTypesResolver(
PluginManager.Current.ResolveDataTypes());
base.Initialize();
//we need to use our own custom IDatabaseFactory for the DatabaseContext because we MUST ensure that
@@ -47,6 +63,9 @@ namespace Umbraco.Tests.Services
[TearDown]
public override void TearDown()
{
//reset the app context
DataTypesResolver.Reset();
_error = null;
//dispose!