Issue #AR-1_serialization: fixes after merge of upstream master
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
using Archetype.Umbraco.PropertyConverters;
|
||||
using at = Archetype.Umbraco.Models;
|
||||
using Archetype.PropertyConverters;
|
||||
using at = Archetype.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Tests.Serialization.Base
|
||||
{
|
||||
public abstract class ArchetypeJsonConverterTestBase
|
||||
{
|
||||
public at.Archetype ConvertModelToArchetype<T>(T model)
|
||||
public at.ArchetypeModel ConvertModelToArchetype<T>(T model)
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var json = JsonConvert.SerializeObject(model);
|
||||
var archetype = (Umbraco.Models.Archetype)converter.ConvertDataToSource(null, json, false);
|
||||
var archetype = (at.ArchetypeModel)converter.ConvertDataToSource(null, json, false);
|
||||
return archetype;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Archetype.Umbraco.Extensions;
|
||||
using Archetype.Umbraco.PropertyEditors;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Archetype.PropertyEditors;
|
||||
using Archetype.Serialization;
|
||||
using Moq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -13,6 +12,7 @@ using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Editors;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
@@ -111,7 +111,7 @@ namespace Archetype.Tests.Serialization.Base
|
||||
{
|
||||
prop.DataTypeGuid = propGuid.ToString();
|
||||
if (prop.Value.ToString().Contains("fieldsets"))
|
||||
prop.PropertyEditorAlias = Umbraco.Constants.PropertyEditorAlias;
|
||||
prop.PropertyEditorAlias = Constants.PropertyEditorAlias;
|
||||
}
|
||||
|
||||
var archetypeJson = JsonConvert.SerializeObject(archetype);
|
||||
@@ -193,9 +193,13 @@ namespace Archetype.Tests.Serialization.Base
|
||||
Mock.Of<IEntityService>(),
|
||||
Mock.Of<IRelationService>(),
|
||||
Mock.Of<IMemberGroupService>(),
|
||||
Mock.Of<IMemberTypeService>(),
|
||||
Mock.Of<IMemberService>(),
|
||||
Mock.Of<IUserService>(),
|
||||
Mock.Of<ISectionService>(),
|
||||
Mock.Of<IApplicationTreeService>(),
|
||||
Mock.Of<ITagService>()
|
||||
Mock.Of<ITagService>(),
|
||||
Mock.Of<INotificationService>()
|
||||
);
|
||||
|
||||
ApplicationContext.EnsureContext(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.PropertyEditors;
|
||||
using Archetype.Serialization;
|
||||
using Archetype.Tests.Serialization.Base;
|
||||
using Archetype.Umbraco.PropertyEditors;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Moq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -129,7 +129,7 @@ namespace Archetype.Tests.Serialization.Delinter
|
||||
{
|
||||
prop.DataTypeGuid = propGuid.ToString();
|
||||
if (prop.Value.ToString().Contains("fieldsets"))
|
||||
prop.PropertyEditorAlias = Umbraco.Constants.PropertyEditorAlias;
|
||||
prop.PropertyEditorAlias = Constants.PropertyEditorAlias;
|
||||
}
|
||||
|
||||
var archetypeJson = JsonConvert.SerializeObject(archetype);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Archetype.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Tests.Serialization.Regression
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Archetype.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Tests.Serialization.UseCases.Complex
|
||||
|
||||
+4
-3
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Models;
|
||||
using Archetype.PropertyConverters;
|
||||
using Archetype.Tests.Serialization.Base;
|
||||
using Archetype.Umbraco.PropertyConverters;
|
||||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
|
||||
@@ -43,7 +44,7 @@ namespace Archetype.Tests.Serialization.UseCases.Enumerable
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var json = JsonConvert.SerializeObject(_feedbacks);
|
||||
var archetype = (Umbraco.Models.Archetype)converter.ConvertDataToSource(null, json, false);
|
||||
var archetype = (ArchetypeModel)converter.ConvertDataToSource(null, json, false);
|
||||
|
||||
Assert.NotNull(archetype);
|
||||
}
|
||||
@@ -93,7 +94,7 @@ namespace Archetype.Tests.Serialization.UseCases.Enumerable
|
||||
{
|
||||
var converter = new ArchetypeValueConverter();
|
||||
var json = JsonConvert.SerializeObject(_captions);
|
||||
var archetype = (Umbraco.Models.Archetype)converter.ConvertDataToSource(null, json, false);
|
||||
var archetype = (ArchetypeModel)converter.ConvertDataToSource(null, json, false);
|
||||
|
||||
Assert.NotNull(archetype);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Archetype.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Tests.Serialization.UseCases.Enumerable
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Archetype.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Archetype.Tests.Serialization.UseCases
|
||||
|
||||
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Umbraco.Core;
|
||||
using Archetype.Models;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Umbraco.Serialization;
|
||||
using Archetype.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Archetype.Umbraco.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Archetype.Umbraco.Serialization
|
||||
using Archetype.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Archetype.Serialization
|
||||
{
|
||||
public class ArchetypeJsonConverter : JsonConverter
|
||||
{
|
||||
@@ -512,9 +512,9 @@ namespace Archetype.Umbraco.Serialization
|
||||
|
||||
private object GetTypedValue(JToken jToken, Type type)
|
||||
{
|
||||
var property = JsonConvert.DeserializeObject<Property>(jToken.ToString());
|
||||
var property = JsonConvert.DeserializeObject<ArchetypePropertyModel>(jToken.ToString());
|
||||
|
||||
var method = typeof(Property).GetMethod("GetValue");
|
||||
var method = typeof(ArchetypePropertyModel).GetMethod("GetValue");
|
||||
var getValue = method.MakeGenericMethod(type);
|
||||
|
||||
return getValue.Invoke(property, null);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Archetype.Umbraco.Serialization
|
||||
namespace Archetype.Serialization
|
||||
{
|
||||
public enum DelinterStep
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Archetype.Umbraco.Serialization
|
||||
using System;
|
||||
|
||||
namespace Archetype.Serialization
|
||||
{
|
||||
public class AsArchetypeAttribute : Attribute
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Archetype.Umbraco.Serialization
|
||||
using System;
|
||||
|
||||
namespace Archetype.Serialization
|
||||
{
|
||||
public class AsFieldsetAttribute : Attribute
|
||||
{
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Archetype.Umbraco.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace Archetype.Umbraco.Serialization
|
||||
using Archetype.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace Archetype.Serialization
|
||||
{
|
||||
public static class SerializationExtensions
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user