This package contains NUnit 3.x Constraints to be used with XMLUnit.NET's core. XMLUnit provides you with the tools to verify the XML you emit is the one you want to create. It provides helpers to validate against an XML Schema, assert the values of XPath queries or compare XML documents against expected outcomes.
$ dotnet add package XMLUnit.NUnit3.ConstraintsXMLUnit provides you with the tools to verify the XML you emit is the one you want to create.
This package provides Constraints on top of the XMLUnit.NET core library to be used with NUnit 3.x. If you are using a different version of NUUnit, please use the package for your version.
[]
XMLUnit requires .NET Standard 2.0 (tested with .NET 8 rigt now) and should still support .NET Framework 3.5 and Mono.
This Constraints package requires NUnit 3.x and XMLUnit.Core.
These are some really small examples, more is available as part of the user guide
Assert.That(CreateTestDocument(), CompareConstraint.IsIdenticalTo(Input.FromFile("test-data/good.xml")));
Assert.That("<foo>bar</foo>", HasXPathConstraint.HasXPath("/foo"));
Assert.That("<foo>bar</foo>", EvaluateXPathConstraint.HasXPath("/foo/text()",
Assert.That(CreateDocument(),
new ValidationConstraint(Input.FromFile("local.xsd")));
XMLUnit.NET is developed at github. More documentation, releases and an issue tracker can be found there.
See the Release Notes at github.