-
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.
Skipped processing of parameterized-content members that have custom …
…serializers applied.
- Loading branch information
1 parent
d834fd9
commit 6cc226e
Showing
2 changed files
with
77 additions
and
9 deletions.
There are no files selected for viewing
33 changes: 24 additions & 9 deletions
33
src/ExtendedXmlSerializer/ExtensionModel/Content/Members/ParameterizedTypeMembers.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
53 changes: 53 additions & 0 deletions
53
test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue458Tests.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,53 @@ | ||
using ExtendedXmlSerializer.Configuration; | ||
using ExtendedXmlSerializer.ContentModel; | ||
using ExtendedXmlSerializer.ContentModel.Format; | ||
using ExtendedXmlSerializer.Tests.ReportedIssues.Support; | ||
using System; | ||
using Xunit; | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues | ||
{ | ||
public sealed class Issue458Tests | ||
{ | ||
[Fact] | ||
public void Verify() | ||
{ | ||
var instance = new DecoratedImage(null); | ||
|
||
var serializer = new ConfigurationContainer().EnableParameterizedContentWithPropertyAssignments() | ||
.UseOptimizedNamespaces() | ||
// | ||
.Type<DecoratedImage>() | ||
.Register() | ||
.Serializer() | ||
.Of<ImageSerializer>() | ||
// | ||
.Create() | ||
.ForTesting(); | ||
|
||
serializer.Assert(instance, @"<?xml version=""1.0"" encoding=""utf-8""?><Issue458Tests-DecoratedImage xmlns=""clr-namespace:ExtendedXmlSerializer.Tests.ReportedIssues;assembly=ExtendedXmlSerializer.Tests.ReportedIssues"" />"); | ||
} | ||
|
||
public class ImageSerializer : ISerializer<DecoratedImage> | ||
{ | ||
public DecoratedImage Get(IFormatReader parameter) => new DecoratedImage(null); | ||
|
||
public void Write(IFormatWriter writer, DecoratedImage instance) {} | ||
} | ||
|
||
public class DecoratedImage | ||
{ | ||
public DecoratedImage(Metadata metadata) => Metadata = metadata; | ||
|
||
public Metadata Metadata | ||
{ | ||
// ReSharper disable once ThrowExceptionInUnexpectedLocation | ||
get => throw new NotImplementedException(); | ||
// ReSharper disable once RedundantAssignment | ||
set => value = null; | ||
} | ||
} | ||
|
||
public class Metadata {} | ||
} | ||
} |