Updated how mappers for persistence work with the MapperFor attribute and have made BaseMapper public but have

kept all properties, etc.. internal just so that they can be found so we don't have to register them.
Updates unit test to ensure the plugin manager is init'd properly with the 'false' override. Ensures that the base
db test also initializes the plugin manager properly.
This commit is contained in:
Shannon Deminick
2013-03-13 01:09:29 +04:00
parent 4efa2c9f57
commit 75d218d2e3
63 changed files with 186 additions and 74 deletions

View File

@@ -1,4 +1,7 @@
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.ObjectResolution;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Tests.TestHelpers
@@ -10,7 +13,31 @@ namespace Umbraco.Tests.TestHelpers
public virtual void Initialize()
{
SqlSyntaxContext.SqlSyntaxProvider = SqlCeSyntax.Provider;
PluginManager.Current = new PluginManager(false);
MappingResolver.Current = new MappingResolver(
() => PluginManager.Current.ResolveAssignedMapperTypes());
//MappingResolver.Current = new MappingResolver(
// new[]
// {
// typeof(ContentMapper),
// typeof(ContentTypeMapper),
// typeof(DataTypeDefinitionMapper),
// typeof(DictionaryMapper),
// typeof(DictionaryTranslationMapper),
// typeof(LanguageMapper),
// typeof(MediaMapper),
// typeof(MediaTypeMapper),
// typeof(PropertyGroupMapper),
// typeof(PropertyMapper),
// typeof(PropertyTypeMapper),
// typeof(RelationMapper),
// typeof(RelationTypeMapper),
// typeof(ServerRegistrationMapper),
// typeof(UserMapper),
// typeof(UserTypeMapper)
// });
Resolution.Freeze();
SetUp();
}
@@ -20,7 +47,9 @@ namespace Umbraco.Tests.TestHelpers
[TearDown]
public virtual void TearDown()
{
MappingResolver.Reset();
SqlSyntaxContext.SqlSyntaxProvider = null;
PluginManager.Current = null;
}
}
}