-
placeholders can now also be used inside of the local part of
xsi:typeattributes. PR #49 -
PlaceholderDifferenceEvaluator would cause InvalidCastException for documents with differences in
xsi:typeattributes. Equivalent of XMLUnit Java Issue #xmlunit/276 -
added readme files for the nuget packages. Issue #46.
-
the NUnit 4.x constraints package tags nunit3 rather than nunit4. PR #43.
-
added Cyclone DX SBOMs to release artifacts Issue #47.
- introduced a new constraints library for NUnit 4.x as the NUnit 3.x constraints can not be used with NUnit 4.x at all. Issue #42.
-
adjusted the NUnit 3.x constraints so they should work for NUnit 4.x as well. Issue #40.
-
add a new
ElementSelectors.ByNameAndAllAttributesvariant that filters attributes before deciding whether elements can be compared. Inspired by Issue #xmlunit/259 -
Nodes.GetMergedNestedTextandNodes.StripElementContentWhitespacehad the same problem of not knowning aboutXmlWhitespacethat caused Issue #38. And neither of the methods could deal withXmlSignificantWhitespaceat all. -
add
XmlWhitespaceStrippedSource,XmlWhitespaceNormalizedSource, andXmlElementContentWhitespaceStrippedSourcethat only trim characters that are considered whitespace by the XML Specification from textual content. Also added new modifiers toDiffBuilderthat make use of the newISourcetypes. Issue #39.
-
added
NodeFilters#SatisfiesAllandSatifiesAnymethods 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.XmlWhitespacethe 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
FullDescriptionmethod toDiffthat provides a string-representation of all differences - not just the first one likeToStringdoes. Based on Java PR xmlunit/#235 by @Boiarshinov
-
ISourcenow extendsIDisposableto allow releasing unmanaged resources used when building sources from files or URIs.This change is backwards incompatible if you are providing
ISourceimplementations of your own. #33. -
DefaultNodeMatcherwith multipleElementSelectors could fail to find the best matches as the order ofElementSelectors 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_LOOKUPdifferences could be wrong whenNodeFilters 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
NodeFilterbeing 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
licenserather than the deprecatedlicenseUrl. -
The
coreandplaceholdersas 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
CompareConstraintorValidationConstraints(both NUnit 2.x and 3.x) as well asEvaluateXPathConstraintorHasXPathConstraint(only the NUnit 3.x versions) pass but the assertion fails because the constraint itself was wrapped in aNotconstraint. -
the NUnit 3.x
EvaluateXPathConstraintfailed to resolve the nested constraint, leading to erroneous messages if the assertion failed. Issue #25 -
the
XmlDocumentinstances used internally inConvertandTransformationnow get theirXmlResolverproperty set tonullby 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
XmlResolverinstance of your own if you need to load external entities.Issue #27.
-
added a new
ISourceimplementationElementContentWhitespaceStrippedSourcewhich is similar toWhitespaceStrippedSourcebut only affects text nodes that solely consist of whitespace and doesn't affect any other text nodes. Also added convenienceIgnoreElementContentWhitespacemethods toDiffBuilderandCompareConstraint. Issue similar to xmlunit/#119. -
the configured
NodeFilteris now applied before comparingXmlDocumentTypenodes.This change breaks backwards compatibility as the old behavior was to ignore
XmlDocumentTypewhen counting the children of theXmlDocumentnode 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_DECLARATIONdifference was detected, this will no longer be the case now. If you want to detect this difference, you need to use a more lenientNodeFilterthanNodeFilters.Default(i.e.NodeFilters.AcceptAll) but then you will see an additionalCHILD_NODELIST_LENGTHdifference.Issue #26.
- elements that only differed in namespace prefix resulted in a false
ELEMENT_TAG_NAMEdifference when compared. Issue #22
CommentLessSource,DiffBuilder#IgnoreCommentsandCompareConstraint#IgnoreCommentsnow 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
DefaultComparisonFormattermore subclass friendly. Issue similar to xmlunit/#93.
- provided xml doc files for the release version and inside the nuget package. user-guide/#11
ValidatorandSchemaValidConstraintnow accept usingXmlSchemainstances for the schema when validating instance documents. Issue similar to xmlunit/#89.
Input.FromByteArrayandInput.FromStringnow returnISources that can be used multiple times. Issue similar to xmlunit/#84.
CompareConstraintandValidationConstraintfor NUnit2 threwNullReferenceExceptions when combined with another failingConstraint. Issue similar to xmlunit/#81.
-
added
CompareConstraint.WithNamespaceContextport of PR #54 by @cboehme. -
added new implementations inside
DifferenceEvaluatorsfor common tasks like changing the outcome for specific differences or ignoring changes inside the XML prolog. -
new
HasXPathconstraints 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.WithComparisonFormatternow also fully applies to theDifferences contained within theDiff. Issue xmlunit/#55
- implemented
DiffBuilder.WithComparisonFormattermentioned in user guide. Issue xmlunit/#51
- the unused
SchemaURIproperty ofValidatorhas been removed. - the mapping of
IDifferenceEngine.NamespaceContexthas been inverted from prefix -> URI to URI -> prefix in order to be consistent with the same concept inIXPathEngine. Comparisonnow 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 isnullin 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
ByXPathelement selector so that "." now refers to the current element. Issue xmlunit/#39 ElementSelectors.ConditionalBuildernow stops at the first predicate returningtrue, even if the associatedElementSelectorreturns 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.