Skip to content

Commit

Permalink
approval changes
Browse files Browse the repository at this point in the history
  • Loading branch information
petrsvihlik committed Dec 10, 2019
1 parent 390455c commit 98d34aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion Kentico.Kontent.Management.Tests/Data/ComplexTestModel.cs
Expand Up @@ -6,7 +6,6 @@

namespace Kentico.Kontent.Management.Tests.Data
{
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
internal class ComplexTestModel
{
[JsonProperty("title")]
Expand Down
Expand Up @@ -46,7 +46,7 @@ public void GetContentItemVariantUpsertModel_ReturnsExpected()

private static void AssertElements(ComplexTestModel expected, ComplexTestModel actual)
{
AssertIdentifiers(expected.TeaserImage.Select(x=>x.Id.Value), actual.TeaserImage.Select(x => x.Id.Value));
AssertIdentifiers(expected.TeaserImage.Select(x => x.Id.Value), actual.TeaserImage.Select(x => x.Id.Value));
Assert.Equal(expected.PostDate, actual.PostDate);
Assert.Equal(expected.UrlPattern, actual.UrlPattern);
AssertIdentifiers(expected.RelatedArticles?.Select(x => x.Id.Value), actual.RelatedArticles?.Select(x => x.Id.Value));
Expand Down Expand Up @@ -74,8 +74,11 @@ private static ComplexTestModel GetTestModel()

private static dynamic ToDynamic(object value)
{
var serialized = JsonConvert.SerializeObject(value);
return JsonConvert.DeserializeObject<dynamic>(serialized, new JsonSerializerSettings{Converters = new JsonConverter[] {new DynamicObjectJsonConverter()}});
var serialized = JsonConvert.SerializeObject(value, new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
});
return JsonConvert.DeserializeObject<dynamic>(serialized, new JsonSerializerSettings { Converters = new JsonConverter[] { new DynamicObjectJsonConverter() } });
}

private static void AssertElements(IDictionary<string, object> expected, IDictionary<string, object> actual)
Expand Down

0 comments on commit 98d34aa

Please sign in to comment.