-
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
Showing
3 changed files
with
64 additions
and
24 deletions.
There are no files selected for viewing
11 changes: 5 additions & 6 deletions
11
src/ExtendedXmlSerializer/ExtensionModel/Xml/FormatReaderContexts.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
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
48 changes: 48 additions & 0 deletions
48
test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue414Tests.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,48 @@ | ||
using ExtendedXmlSerializer.Configuration; | ||
using ExtendedXmlSerializer.Tests.ReportedIssues.Support; | ||
using FluentAssertions; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Xml.Linq; | ||
using Xunit; | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues | ||
{ | ||
public sealed class Issue414Tests | ||
{ | ||
[Fact] | ||
public void Verify() | ||
{ | ||
var serializer = new ConfigurationContainer().Type<Base>() | ||
.AddMigration(EmptyMigration.Default) | ||
.Create() | ||
.ForTesting(); | ||
var container = new Container {Content = new Inherit()}; | ||
serializer.Cycle(container).Should().BeEquivalentTo(container); | ||
} | ||
|
||
public class Container | ||
{ | ||
public Base Content { get; set; } | ||
} | ||
|
||
public class Inherit : Base {} | ||
|
||
public class Base {} | ||
|
||
sealed class EmptyMigration : IEnumerable<Action<XElement>> | ||
{ | ||
public static EmptyMigration Default { get; } = new EmptyMigration(); | ||
|
||
EmptyMigration() {} | ||
|
||
public IEnumerator<Action<XElement>> GetEnumerator() | ||
{ | ||
yield break; | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
} | ||
} | ||
} |