-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18c5bc3
commit 4ab31a2
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue604Tests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using ExtendedXmlSerializer.Configuration; | ||
using ExtendedXmlSerializer.ExtensionModel.Types.Sources; | ||
using ExtendedXmlSerializer.Tests.ReportedIssues.Support; | ||
using FluentAssertions; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Xunit; | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues | ||
{ | ||
public sealed class Issue604Tests | ||
{ | ||
[Fact] | ||
public void Verify() | ||
{ | ||
var enumerable = new InspectedPropertyTypes<Subject>().Concat(new[] { typeof(DictionaryEntry) }); | ||
var subject = new ConfigurationContainer().Type<DictionaryEntry>() | ||
.Name("Entry") | ||
.EnableImplicitTyping(enumerable) | ||
.Create() | ||
.ForTesting(); | ||
var instance = new Subject { Store = new() { { "Hello", true }, { "World", false } } }; | ||
subject.Assert(instance, | ||
@"<?xml version=""1.0"" encoding=""utf-8""?><Issue604Tests-Subject><Store><Entry><Key>Hello</Key><Value>true</Value></Entry><Entry><Key>World</Key><Value>false</Value></Entry></Store></Issue604Tests-Subject>") | ||
.Should() | ||
.BeEquivalentTo(instance); | ||
} | ||
|
||
public sealed class Subject | ||
{ | ||
public Dictionary<string, bool> Store { get; set; } | ||
} | ||
} | ||
} |