Skip to content

Commit

Permalink
Merge 744f3e6 into e8abfa3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-E-angelo authored Aug 11, 2020
2 parents e8abfa3 + 744f3e6 commit 454f915
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue423Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using ExtendedXmlSerializer.Configuration;
using ExtendedXmlSerializer.Tests.ReportedIssues.Support;
using FluentAssertions;
using JetBrains.Annotations;
using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace ExtendedXmlSerializer.Tests.ReportedIssues
{
public sealed class Issue423Tests
{
[Fact]
public void Verify()
{
var serializer = new ConfigurationContainer().UseOptimizedNamespaces().Create().ForTesting();
var first = new Subject
{
Message = "Hello World!",
Dictionaries =
{
new Dictionary<int, string> {[123] = "Hello", [456] = "World"},
new Dictionary<int, string> {[678] = "Hello", [910] = "World"}
}
};
var second = new Subject
{
Message = "Hello again!",
Dictionaries =
{
new Dictionary<int, string> {[1112] = "Hello", [1314] = "Again"},
new Dictionary<int, string> {[1516] = "Hello", [1718] = "Again"}
}
};
var instance = new[] {first, second}.ToList();

serializer.Cycle(instance).Should().BeEquivalentTo(instance);
}

sealed class Subject
{
[UsedImplicitly]
public string Message { get; set; }

[UsedImplicitly]
public List<Dictionary<int, string>> Dictionaries { get; set; } = new List<Dictionary<int, string>>();
}
}
}

0 comments on commit 454f915

Please sign in to comment.