-
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.
Demonstration of EnableReferences (#564)
- Loading branch information
1 parent
39751a9
commit 08876f4
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
35 changes: 35 additions & 0 deletions
35
test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue563Tests.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.Tests.ReportedIssues.Support; | ||
using FluentAssertions; | ||
using System.Collections.Generic; | ||
using Xunit; | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues; | ||
|
||
public sealed class Issue563Tests | ||
{ | ||
[Fact] | ||
public void Verify() | ||
{ | ||
var subject = new ConfigurationContainer().EnableReferences().Create().ForTesting(); | ||
var instance = new Subject(); | ||
subject.Cycle(instance).Should().BeEquivalentTo(instance); | ||
} | ||
|
||
sealed class Subject | ||
{ | ||
public List<byte[]> ParentKey { get; set; } = new (); | ||
public byte[] Id { get; set; } | ||
|
||
public List<byte[]> Key | ||
{ | ||
get | ||
{ | ||
List<byte[]> result = new(ParentKey); | ||
result.Add(Id); | ||
return result; | ||
} | ||
} | ||
|
||
} | ||
} |