-
adjusted the NUnit 3.x constraints so they should work for NUnit 4.x as well. Issue #40.
-
add a new
ElementSelectors.ByNameAndAllAttributes
variant that filters attributes before deciding whether elements can be compared. Inspired by Issue #xmlunit/259 -
Nodes.GetMergedNestedText
andNodes.StripElementContentWhitespace
had the same problem of not knowning aboutXmlWhitespace
that caused Issue #38. And neither of the methods could deal withXmlSignificantWhitespace
at all. -
add
XmlWhitespaceStrippedSource
,XmlWhitespaceNormalizedSource
, andXmlElementContentWhitespaceStrippedSource
that only trim characters that are considered whitespace by the XML Specification from textual content. Also added new modifiers toDiffBuilder
that make use of the newISource
types. Issue #39.
-
added
NodeFilters#SatisfiesAll
andSatifiesAny
methods to make it easier to combine multiple node filters. added to simplify the use case of xmlunit/#249 -
when documents contained element content whitespace represented by
System.Xml.XmlWhitespace
the types and methods that are supposed to strip or normalize whitespace would fail. Issue #38
-
improved comparison performance for documents with many siblings based on a suggestion by @gerpres made in Java Issue xmlunit/#236
-
added a new
FullDescription
method toDiff
that provides a string-representation of all differences - not just the first one likeToString
does. Based on Java PR xmlunit/#235 by @Boiarshinov
-
ISource
now extendsIDisposable
to allow releasing unmanaged resources used when building sources from files or URIs.This change is backwards incompatible if you are providing
ISource
implementations of your own. #33. -
DefaultNodeMatcher
with multipleElementSelector
s could fail to find the best matches as the order ofElementSelector
s should select them. Issue similar to xmlunit/#197
This version contains a backwards incompatible change to the
IPlaceholderHandler
interface that is part of the experimental
placeholders module: The Evaluate
method now receives a variable
number of string arguments in addition to the textual content of the
element/attribute. This allows placeholders like
${xmlunit.matchesRegex(some\s*regex)}
.
-
add a new
${xmlunit.isDateTime}
placeholder #31 and #32 by MilkyWare -
added a new
${xmlunit.matchesRegex(regex)}
placeholder based on Java PR xmlunit/#178 by @Jazzyekim.
- the XPath values for comparisons resulting in
CHILD_LOOKUP
differences could be wrong whenNodeFilter
s were present. Issue #29
-
add a new
${xmlunit.isNumber}
placeholder Based on the Java PR xmlunit/#154 by @NathanAtClarity. -
the XPath values of a comparison should not be affected by any
NodeFilter
being in effect. Issue similar to xmlunit/#156
This release is identical to 2.7.0-beta-01 with only the version numbers changed.
This is the first release supporting .NET Standard 2.0. If you still want/need the assemblies targeting .NET Framework 3.5 they are still part of the nuget packages as well and you shouldn't see any differences when compared to XMLUnit.NET 2.6.0.
The NUnit 2.x constraints still only support the .NET Framework as NUnit 2.x itself doesn't support .NET Standard either.
-
The nuspec files now use
license
rather than the deprecatedlicenseUrl
. -
The
core
andplaceholders
as well as the NUnit 3.x constraints nuget packages now contain assemblies built for .NET Standard 2.0.Issue #21 based on Pull Request #28 by @shatl.
As part of this the dependency of the NUnit 3.x constraints on NUnit has been bumped to 3.6.1 which was the first version supporting .NET Standard 2.0.
-
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
orValidationConstraints
(both NUnit 2.x and 3.x) as well asEvaluateXPathConstraint
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
andTransformation
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 explicit
XmlResolver
instance of your own if you need to load external entities.Issue #27.
-
added a new
ISource
implementationElementContentWhitespaceStrippedSource
which is similar toWhitespaceStrippedSource
but only affects text nodes that solely consist of whitespace and doesn't affect any other text nodes. Also added convenienceIgnoreElementContentWhitespace
methods toDiffBuilder
andCompareConstraint
. Issue similar to xmlunit/#119. -
the configured
NodeFilter
is now applied before comparingXmlDocumentType
nodes.This change breaks backwards compatibility as the old behavior was to ignore
XmlDocumentType
when counting the children of theXmlDocument
node but not when actually comparing theXmlDocumentType
. 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 lenientNodeFilter
thanNodeFilters.Default
(i.e.NodeFilters.AcceptAll
) but then you will see an additionalCHILD_NODELIST_LENGTH
difference.Issue #26.
- elements that only differed in namespace prefix resulted in a false
ELEMENT_TAG_NAME
difference when compared. Issue #22
CommentLessSource
,DiffBuilder#IgnoreComments
andCompareConstraint#IgnoreComments
now all use XSLT version 2.0 stylesheets in order to strip comments. New constructors and methods have been added if you need a different version of XSLT (in particular if you need 1.0 which used to be the default up to XMLUnit 2.4.0). Issue similar to xmlunit/#99.
- made
DefaultComparisonFormatter
more subclass friendly. Issue similar to xmlunit/#93.
- provided xml doc files for the release version and inside the nuget package. user-guide/#11
Validator
andSchemaValidConstraint
now accept usingXmlSchema
instances for the schema when validating instance documents. Issue similar to xmlunit/#89.
Input.FromByteArray
andInput.FromString
now returnISource
s that can be used multiple times. Issue similar to xmlunit/#84.
CompareConstraint
andValidationConstraint
for NUnit2 threwNullReferenceException
s when combined with another failingConstraint
. Issue similar to xmlunit/#81.
-
added
CompareConstraint.WithNamespaceContext
port of PR #54 by @cboehme. -
added new implementations inside
DifferenceEvaluators
for common tasks like changing the outcome for specific differences or ignoring changes inside the XML prolog. -
new
HasXPath
constraints that check for the existence of an XPath inside of a piece of XML or verify additional assertions on the XPath's stringified result. Port of corresponding matchers in XMLUnit for Java by @mariusneo. -
DiffBuilder.WithComparisonFormatter
now also fully applies to theDifference
s contained within theDiff
. Issue xmlunit/#55
- implemented
DiffBuilder.WithComparisonFormatter
mentioned in user guide. Issue xmlunit/#51
- the unused
SchemaURI
property ofValidator
has been removed. - the mapping of
IDifferenceEngine.NamespaceContext
has been inverted from prefix -> URI to URI -> prefix in order to be consistent with the same concept inIXPathEngine
. Comparison
now also contains the XPath of the parent of the compared nodes or attributes which is most useful in cases of missing nodes/attributes because the XPath on one side isnull
in these cases. Issue xmlunit/#48 ported from PR xmlunit/#50 by @eguib.
- fixed the nuget package name of the core library to now use XMLUnit.Core
- switched core tests to use to NUnit 3.x and provided a new library to support NUnit 3.x constraints. #19 by @e-tobi
- The XMLUnit.Constraints nuget package has been replaced with XMLUnit.NUnit2.Constraints and XMLUnit.NUnit3.Constraints
- The XMLUnit.NUnit2.Constraints nuget package now depends on NUNit 2.6.4 - which it has been compiled against - rather than 2.5.10.
- added new overloads to
IXPathEngine
- fixed the XPath context used by the
ByXPath
element selector so that "." now refers to the current element. Issue xmlunit/#39 ElementSelectors.ConditionalBuilder
now stops at the first predicate returningtrue
, even if the associatedElementSelector
returns false. Issue xmlunit/#40
This is the initial alpha release of XMLUnit.NET. We expect the API to change for the next release based on user feedback.