XMLUnit.NET 2.6.0
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
orHasXPathConstraint
(only the NUnit
3.x versions) pass but the assertion fails because the constraint
itself was wrapped in aNot
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 inConvert
and
Transformation
now get theirXmlResolver
property set tonull
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
explicitXmlResolver
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 convenienceIgnoreElementContentWhitespace
methods to
DiffBuilder
andCompareConstraint
.
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 ignoreXmlDocumentType
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, aHAS_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
thanNodeFilters.Default
(i.e.NodeFilters.AcceptAll
) but then you will see an additional
CHILD_NODELIST_LENGTH
difference.Issue #26.