diff --git a/test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue423Tests.cs b/test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue423Tests.cs new file mode 100644 index 000000000..c2e897b21 --- /dev/null +++ b/test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue423Tests.cs @@ -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 {[123] = "Hello", [456] = "World"}, + new Dictionary {[678] = "Hello", [910] = "World"} + } + }; + var second = new Subject + { + Message = "Hello again!", + Dictionaries = + { + new Dictionary {[1112] = "Hello", [1314] = "Again"}, + new Dictionary {[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> Dictionaries { get; set; } = new List>(); + } + } +} \ No newline at end of file