-
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.
Accounted for struct root instances when references are enabled.
- Loading branch information
1 parent
1317d44
commit 13bc54e
Showing
3 changed files
with
57 additions
and
2 deletions.
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
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/Issue358Tests.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 Xunit; | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues | ||
{ | ||
public sealed class Issue358Tests | ||
{ | ||
[Fact] | ||
void Verify() | ||
{ | ||
var serializer = new ConfigurationContainer() | ||
.EnableParameterizedContentWithPropertyAssignments() | ||
.EnableReferences() | ||
.Create() | ||
.ForTesting(); | ||
|
||
var instance = new vector(new length(11), new length(13)); | ||
|
||
var cycled = serializer.Cycle(instance); | ||
cycled.L1.Value.Should().Be(instance.L1.Value); | ||
cycled.L2.Value.Should().Be(instance.L2.Value); | ||
} | ||
|
||
class length | ||
{ | ||
public length(int value) | ||
{ | ||
Value = value; | ||
} | ||
|
||
public int Value { get; } | ||
} | ||
|
||
private struct vector | ||
{ | ||
public vector(length l1, length l2) | ||
{ | ||
L1 = l1; | ||
L2 = l2; | ||
} | ||
|
||
public length L1 { get; } | ||
public length L2 { get; } | ||
} | ||
} | ||
} |