Skip to content

Commit

Permalink
Demonstration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-E-angelo committed Sep 19, 2023
1 parent 18c5bc3 commit 4ab31a2
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue604Tests.cs
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; }
}
}
}

0 comments on commit 4ab31a2

Please sign in to comment.