Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ should still support .NET Framework 3.5 and Mono.

The `core` library provides all functionality needed to test XML
output and hasn't got any dependencies. It uses NUnit 3.x for its own
tests. The core library is complemented by two libaries of NUnit
constraints targeting NUnit 2.x and 3.x respectively.
tests. The core library is complemented by libaries of NUnit
constraints targeting NUnit 2.x, 3.x and 4.x respectively.

Building NUnit 4.x support requires .NET 6 or .NET Framework 4.6.2 or
newer (the minimal targets supported by NUnit 4.x).

## Checking out XMLUnit.NET

Expand Down Expand Up @@ -225,6 +228,14 @@ assemblies. In order to run the tests use
> dotnet test src/tests/net-placeholders/XMLUnit.Placeholders.Tests.csproj
```

NUnit4 support is not part of the default solution so the solution can
be built for .NET prior to .NET 6. In order to build and test it, use

```sh
> dotnet build src/main/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.csproj
> dotnet test src/tests/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.Test.csproj
```

You may need to specify
[`--roll-forward`](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet#rollforward)
or
Expand Down
8 changes: 7 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Release Notes

## XMLUnit.NET 2.10.1 - /not released, yet/
## XMLUnit.NET 2.11.1 - /Not Released, yet/

## XMLUnit.NET 2.11.0 - /Released 2025-03-28/

* 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](https://github.com/xmlunit/xmlunit.net/issues/42).

## XMLUnit.NET 2.10.0 - /Released 2024-08-08/

Expand Down
13 changes: 0 additions & 13 deletions XMLUnit.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XMLUnit.Placeholders.Tests"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{AEB02F96-2A15-4740-84CB-6F7E36F85062}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLUnit.NUnit4.Constraints.Test", "src\tests\net-constraints-nunit4\XMLUnit.NUnit4.Constraints.Test.csproj", "{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLUnit.NUnit4.Constraints", "src\main\net-constraints-nunit4\XMLUnit.NUnit4.Constraints.csproj", "{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -63,14 +59,6 @@ Global
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F}.Release|Any CPU.Build.0 = Release|Any CPU
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Release|Any CPU.Build.0 = Release|Any CPU
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -79,7 +67,6 @@ Global
{9BF85579-75BF-4D44-953A-46FAFCD814C0} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
{33760FFE-9F43-46BE-8F64-ED34AE6B798C} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {62909FEB-64D4-42B9-845A-E7E1AAD5F331}
Expand Down
17 changes: 14 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.11.0.{build}
version: 2.11.1.{build}

image:
- Ubuntu2204
Expand Down Expand Up @@ -29,18 +29,29 @@ for:
- matrix:
only:
- image: Visual Studio 2017
before_build:
- dotnet restore XMLUnit.NET.sln
build:
project: XMLUnit.NET.sln
test_script:
- dotnet test src/tests/net-core/XMLUnit.Core.Tests.csproj
- dotnet test src/tests/net-constraints-nunit3/XMLUnit.NUnit3.Constraints.Test.csproj
- dotnet test src/tests/net-placeholders/XMLUnit.Placeholders.Tests.csproj

- matrix:
only:
- image: Visual Studio 2022
- image: Ubuntu2204
before_build:
- dotnet restore XMLUnit.NET.sln
- dotnet --version
build:
project: XMLUnit.NET.sln
test_script:
- dotnet test src/tests/net-core/XMLUnit.Core.Tests.csproj
- dotnet test src/tests/net-constraints-nunit3/XMLUnit.NUnit3.Constraints.Test.csproj
- dotnet test src/tests/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.Test.csproj
- dotnet test src/tests/net-placeholders/XMLUnit.Placeholders.Tests.csproj
- dotnet build src/main/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.csproj
- dotnet test src/tests/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.Test.csproj

install:
- cmd: git submodule update --init
Expand Down
6 changes: 5 additions & 1 deletion create-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ cp README.md LICENSE RELEASE_NOTES.md build/bindist-tmp/xmlunit-$1
for d in Debug Release; do
mkdir -p build/bindist-tmp/xmlunit-$1/NetFramework/$d
mkdir -p build/bindist-tmp/xmlunit-$1/netstandard2.0/$d
mkdir -p build/bindist-tmp/xmlunit-$1/net6.0/$d
mkdir -p build/bindist-tmp/xmlunit-$1/net462/$d
cp build/NetFramework/bin/$d/xmlunit-* build/bindist-tmp/xmlunit-$1/NetFramework/$d
cp build/bin/$d/netstandard2.0/xmlunit-* build/bindist-tmp/xmlunit-$1/netstandard2.0/$d
cp build/bin/$d/net6.0/xmlunit-* build/bindist-tmp/xmlunit-$1/net6.0/$d
cp build/bin/$d/net462/xmlunit-* build/bindist-tmp/xmlunit-$1/net462/$d
done
mkdir build/bindist-tmp/xmlunit-$1/apidocs
cp -r build/NetFramework/html/* build/bindist-tmp/xmlunit-$1/apidocs
Expand All @@ -53,5 +57,5 @@ mv xmlunit-$1-src.* ..
cd ..
for i in *.zip *.tar.gz *.tar.bz2; do
sha256sum $i > $i.sha256
gpg --detach-sign --armor $i
gpg --detach-sign --armor --use-agent $i
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Namespace Name="Org.XmlUnit.Constraints">
<Docs>
<summary>NUnit 4.x Constraints on top of XMLUnit's core.</summary>
<remarks>NUnit 4.x Constraints on top of XMLUnit's core.</remarks>
</Docs>
</Namespace>
6 changes: 5 additions & 1 deletion src/doc/monodoc/core/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
contains <format type="text/html"><a
href="http://nunit.org/">NUnit 3.x</a></format>
constraints on top of <c>XMLUnit.Core</c>.</term></item>
<item><term><c>XMLUnit.NUnit4.Constraints</c>
contains <format type="text/html"><a
href="http://nunit.org/">NUnit 4.x</a></format>
constraints on top of <c>XMLUnit.Core</c>.</term></item>
</list>

<para>While XMLUnit is focussed on testing, parts of it may be useful
Expand Down Expand Up @@ -58,5 +62,5 @@
under <format type="text/html"><a href="https://github.com/xmlunit/xmlunit.net/blob/main/LICENSE">the
Apache License, Version 2.0</a></format>.</para></Remarks>
<Copyright></Copyright>
<Title>XMLUnit.NET 2.10.1</Title>
<Title>XMLUnit.NET 2.11.1</Title>
</Overview>
8 changes: 5 additions & 3 deletions src/doc/monodoc/run-monodoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ OUT_DIR="$BUILD/doc"
HTML_DIR="$BUILD/html"
rm -rf "$OUT_DIR" "$HTML_DIR"
mkdir -p "$OUT_DIR"
cp -r "$MY_DIR/core" "$MY_DIR/placeholders" "$MY_DIR/constraints-nunit2" "$MY_DIR/constraints-nunit3" "$OUT_DIR"
cp -r "$MY_DIR/core" "$MY_DIR/placeholders" "$MY_DIR/constraints-nunit2" "$MY_DIR/constraints-nunit3" "$MY_DIR/constraints-nunit4" "$OUT_DIR"

monodocer -pretty -importslashdoc:"$DEBUG_DIR/xmlunit-core.xml"\
-assembly:"$DEBUG_DIR/xmlunit-core.dll"\
-path:"$OUT_DIR/core"
monodocer -pretty -importslashdoc:"$DEBUG_DIR/xmlunit-nunit4-constraints.xml"\
-assembly:"$DEBUG_DIR/xmlunit-nunit4-constraints.dll"\
-path:"$OUT_DIR/constraints-nunit4"
monodocer -pretty -importslashdoc:"$DEBUG_DIR/xmlunit-nunit3-constraints.xml"\
-assembly:"$DEBUG_DIR/xmlunit-nunit3-constraints.dll"\
-path:"$OUT_DIR/constraints-nunit3"
Expand All @@ -25,5 +28,4 @@ monodocer -pretty -importslashdoc:"$DEBUG_DIR/xmlunit-placeholders.xml"\
-assembly:"$DEBUG_DIR/xmlunit-placeholders.dll"\
-path:"$OUT_DIR/placeholders"

monodocs2html -out "$HTML_DIR" "$OUT_DIR/core" "$OUT_DIR/constraints-nunit3" "$OUT_DIR/constraints-nunit2" "$OUT_DIR/placeholders"

monodocs2html -out "$HTML_DIR" "$OUT_DIR/core" "$OUT_DIR/constraints-nunit4" "$OUT_DIR/constraints-nunit3" "$OUT_DIR/constraints-nunit2" "$OUT_DIR/placeholders"
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is licensed to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B0EA2DD8-D0BC-4B55-B17A-E3EE17D6C718}</ProjectGuid>
<OutputType>Library</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<AssemblyName>xmlunit-nunit4-constraints</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\build\NetFramework\bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\..\..\build\NetFramework\bin\Debug\xmlunit-nunit4-constraints.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\..\build\NetFramework\bin\Release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\..\..\build\NetFramework\bin\Release\xmlunit-nunit4-constraints.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\..\..\xmlunit.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Org.XmlUnit.Constraints</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=4.3.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb">
<HintPath>..\..\..\..\packages\NUnit.4.3.2\lib\net462\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\net-core\NetFramework\XMLUnit.Core.NetFramework.csproj">
<Project>{97960a9c-7e2b-4548-90bd-31105c54e129}</Project>
<Name>XMLUnit.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\shared\CommonAssemblyInfo.cs">
<Link>..\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\AssemblyInfo.cs" />
<Compile Include="..\CompareConstraint.cs" />
<Compile Include="..\EvaluateXPathConstraint.cs" />
<Compile Include="..\HasXPathConstraint.cs" />
<Compile Include="..\ValidationConstraints.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" />
<ProjectExtensions>
<VisualStudio AllowExistingFolder="true" />
</ProjectExtensions>
</Project>
4 changes: 4 additions & 0 deletions src/main/net-constraints-nunit4/NetFramework/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="4.3.2" targetFramework="net462" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
limitations under the License.
-->

<Project>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net6.0;net462</TargetFrameworks>
Expand Down Expand Up @@ -53,8 +51,4 @@
<ItemGroup>
<PackageReference Include="NUnit" Version="4.3.2" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="..\..\shared\no-build.targets"
Condition="$([System.Environment]::Version) &lt; 6.0.0.0"/>
</Project>
34 changes: 34 additions & 0 deletions src/main/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>XMLUnit.NUnit4.Constraints</id>
<version>$version$</version>
<title>XMLUnit Constraints for NUnit 4.</title>
<authors>XMLUnit Contributors</authors>
<owners />
<projectUrl>https://www.xmlunit.org/</projectUrl>
<license type="expression">Apache-2.0</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This package contains NUnit 4.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.</description>
<summary>NUnit 4.x Constraints Classes of XMLUnit.NET</summary>
<dependencies>
<dependency id="NUnit" version="4.3.2" />
<dependency id="XMLUnit.Core" version="[$version$]" />
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Xml" />
<frameworkAssembly assemblyName="System.Xml.Linq" />
</frameworkAssemblies>
<tags>xmlunit xml unit-testing test xmldiff nunit nunit3</tags>
</metadata>
<files>
<file src="..\..\..\build/NetFramework/bin/Release/xmlunit-nunit4-constraints.dll" target="lib\net462"/>
<file src="..\..\..\build/NetFramework/bin/Release/xmlunit-nunit4-constraints.pdb" target="lib\net462"/>
<file src="..\..\..\build/NetFramework/bin/Release/xmlunit-nunit4-constraints.xml" target="lib\net462"/>
<file src="..\..\..\build/bin/Release/net6.0/xmlunit-nunit4-constraints.dll" target="lib\net6.0"/>
<file src="..\..\..\build/bin/Release/net6.0/xmlunit-nunit4-constraints.pdb" target="lib\net6.0"/>
<file src="..\..\..\build/bin/Release/net6.0/xmlunit-nunit4-constraints.xml" target="lib\net6.0"/>
</files>
</package>
4 changes: 2 additions & 2 deletions src/shared/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace Org.XmlUnit
{
internal static class XmlUnitVersion
{
internal const string ApiVersion = "2.11.0";
internal const string AssemblyVersion = ApiVersion + ".256";
internal const string ApiVersion = "2.11.1";
internal const string AssemblyVersion = ApiVersion + ".283";
internal const string Version = ApiVersion + "-alpha";
}
}
5 changes: 0 additions & 5 deletions src/shared/no-build.targets

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
limitations under the License.
-->

<Project>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net6.0</TargetFrameworks>
Expand Down Expand Up @@ -57,8 +55,4 @@
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="..\..\shared\no-build.targets"
Condition="$([System.Environment]::Version) &lt; 6.0.0.0"/>
</Project>