-
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 successive CDATA blocks.
- Loading branch information
1 parent
55868aa
commit ae1b01d
Showing
3 changed files
with
65 additions
and
3 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
36 changes: 36 additions & 0 deletions
36
test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue447Tests.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,36 @@ | ||
using ExtendedXmlSerializer.Configuration; | ||
using ExtendedXmlSerializer.ContentModel.Content; | ||
using ExtendedXmlSerializer.Tests.ReportedIssues.Support; | ||
using FluentAssertions; | ||
using JetBrains.Annotations; | ||
using Xunit; | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues | ||
{ | ||
public sealed class Issue447Tests | ||
{ | ||
[Fact] | ||
public void Verify() | ||
{ | ||
const string content = @"<?xml version=""1.0"" encoding=""utf-8""?><Issue447Tests-Subject xmlns=""clr-namespace:ExtendedXmlSerializer.Tests.ReportedIssues;assembly=ExtendedXmlSerializer.Tests.ReportedIssues""><Message><![CDATA[Hello ]]><![CDATA[world!]]></Message><Message2><![CDATA[Not ]]><![CDATA[this.]]></Message2></Issue447Tests-Subject>"; | ||
|
||
var serializer = new ConfigurationContainer().Create() | ||
.ForTesting(); | ||
|
||
serializer.Deserialize<Subject>(content) | ||
.Message.Should().Be("Hello world!"); | ||
|
||
serializer.Deserialize<Subject>(content) | ||
.Message2.Should().Be("Not this."); | ||
} | ||
|
||
sealed class Subject | ||
{ | ||
[Verbatim] | ||
public string Message { get; [UsedImplicitly] set; } | ||
|
||
[Verbatim] | ||
public string Message2 { get; [UsedImplicitly] set; } | ||
} | ||
} | ||
} |