Skip to content

Latest commit

 

History

History
108 lines (85 loc) · 2.97 KB

verify-xml.md

File metadata and controls

108 lines (85 loc) · 2.97 KB

VerifyXml

Verifies Xml:

  • Scrubbing respected.
  • Pretty prints

[Fact]
public Task VerifyFilePath() =>
    VerifyFile("sample.txt");

snippet source | anchor

Give the following Xml:

<body><node>text</node></body>

This code:

[Fact]
public Task Xml() =>
    VerifyXml(xml);

snippet source | anchor

Will produce

<body>
  <node>text</node>
</body>

snippet source | anchor

IgnoreMember

This code:

[Fact]
public Task XmlIgnoreMember() =>
    VerifyXml(xml)
        .IgnoreMember("node");

snippet source | anchor

Will produce

<body />

snippet source | anchor

ScrubMember

This code:

[Fact]
public Task XmlScrubMember() =>
    VerifyXml(xml)
        .ScrubMember("node");

snippet source | anchor

Will produce

<body>
  <node>Scrubbed</node>
</body>

snippet source | anchor