Skip to content

XMLUnit.NET 2.6.0

Compare
Choose a tag to compare
@bodewig bodewig released this 22 Apr 10:10
· 78 commits to master since this release

This release fixes a few bugs and introduces a new experimental feature.

The full list of changes for XMLUnit.NET:

  • add a new experimental module xmlunit-placeholders which aims to
    use ${xmlunit.FOO} expressions inside of the control document to
    allow for a DSL-like approach of defining more complex tests.
    This initial seed only supports ${xmlunit.ignore} which can be
    used to make XMLUnit ignore the element containing this text.

  • fixed the message when CompareConstraint or
    ValidationConstraints (both NUnit 2.x and 3.x) as well as
    EvaluateXPathConstraint or HasXPathConstraint (only the NUnit
    3.x versions) pass but the assertion fails because the constraint
    itself was wrapped in a Not constraint.

  • the NUnit 3.x EvaluateXPathConstraint failed to resolve the nested
    constraint, leading to erroneous messages if the assertion failed.
    Issue #25

  • the XmlDocument instances used internally in Convert and
    Transformation now get their XmlResolver property set to null
    by default - which happens to be the default value of .NET 4.5.2 and
    later anyway. This is in accordance with the OWASP recommendations
    for XML eXternal Entity injection
    preventions
    .

    This may be a breaking change and you may need to provide an
    explicit XmlResolver instance of your own if you need to load
    external entities.

    Issue #27.

  • added a new ISource implementation
    ElementContentWhitespaceStrippedSource which is similar to
    WhitespaceStrippedSource but only affects text nodes that solely
    consist of whitespace and doesn't affect any other text nodes. Also
    added convenience IgnoreElementContentWhitespace methods to
    DiffBuilder and CompareConstraint.
    Issue similar to xmlunit/#119.

  • the configured NodeFilter is now applied before comparing
    XmlDocumentType nodes.

    This change breaks backwards compatibility as the old behavior was
    to ignore XmlDocumentType when counting the children of the
    XmlDocument node but not when actually comparing the
    XmlDocumentType. Prior to this change if one document had a document
    type declaration but the other didn't, a HAS_DOCTYPE_DECLARATION
    difference was detected, this will no longer be the case now. If you
    want to detect this difference, you need to use a more lenient
    NodeFilter than NodeFilters.Default
    (i.e. NodeFilters.AcceptAll) but then you will see an additional
    CHILD_NODELIST_LENGTH difference.

    Issue #26.