Skip to content

Commit

Permalink
Merge pull request #20 from CaptnCodr/feature/update-xunit
Browse files Browse the repository at this point in the history
Update xunit to version 2.5.0
  • Loading branch information
CaptnCodr authored Jul 10, 2023
2 parents 7882e6e + ec5959c commit 38d4eb6
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/NHamcrest.NUnit/NHamcrest.NUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Copyright>Copyright © 2023</Copyright>
<Version Condition="'$(VersionSuffix)' == ''">3.2.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">3.2.0-$(VersionSuffix)</Version>
<Version Condition="'$(VersionSuffix)' == ''">3.3.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">3.3.0-$(VersionSuffix)</Version>
<Description>Adapter for NUnit for using NHamcrest library</Description>
<Authors>Graham Hay, Algirdas Lašas, Constantin Tews</Authors>
<PackageLicenseUrl>https://github.com/nhamcrest/NHamcrest/blob/master/LICENCE.txt</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/nhamcrest/NHamcrest</PackageProjectUrl>
<PackageTags>unittesting hamcrest matcher test</PackageTags>
<AssemblyVersion>3.2.0.0</AssemblyVersion>
<FileVersion>3.2.0.0</FileVersion>
<AssemblyVersion>3.3.0.0</AssemblyVersion>
<FileVersion>3.3.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
Expand Down
6 changes: 3 additions & 3 deletions src/NHamcrest.Tests/NHamcrest.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<Compile Remove="FeatureMatcherTests.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Castle.Core" Version="5.1.1" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Microsoft.NET.TEST.Sdk" Version="17.6.2" />
<PackageReference Include="Microsoft.NET.TEST.Sdk" Version="17.6.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest.XUnit\NHamcrest.XUnit.csproj" />
Expand Down
9 changes: 6 additions & 3 deletions src/NHamcrest.XUnit.Examples/NHamcrest.XUnit.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest.XUnit\NHamcrest.XUnit.csproj" />
Expand Down
10 changes: 6 additions & 4 deletions src/NHamcrest.XUnit/AssertEx.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NHamcrest.Core;
using Xunit.Sdk;
using NHamcrest.Core;

namespace NHamcrest.XUnit
{
Expand All @@ -13,7 +14,7 @@ public class Assert : Xunit.Assert
/// <typeparam name="T"></typeparam>
/// <param name="actual"></param>
/// <param name="matcher"></param>
/// <exception cref="MatchException"></exception>
/// <exception cref="EqualException"></exception>
public static void That<T>(T actual, IMatcher<T> matcher)
{
That(actual, matcher, null);
Expand All @@ -26,6 +27,7 @@ public static void That<T>(T actual, IMatcher<T> matcher)
/// <param name="actual"></param>
/// <param name="matcher"></param>
/// <param name="message"></param>
/// <exception cref="EqualException"></exception>
public static void That<T>(T actual, IMatcher<T> matcher, string message)
{
That(actual, matcher, message, null);
Expand All @@ -39,7 +41,7 @@ public static void That<T>(T actual, IMatcher<T> matcher, string message)
/// <param name="matcher"></param>
/// <param name="message"></param>
/// <param name="args"></param>
/// <exception cref="MatchException"></exception>
/// <exception cref="EqualException"></exception>
public static void That<T>(T actual, IMatcher<T> matcher, string message, params object[] args)
{
if (matcher.Matches(actual))
Expand All @@ -55,7 +57,7 @@ public static void That<T>(T actual, IMatcher<T> matcher, string message, params
? string.Format(message, args)
: message;

throw new MatchException(description.ToString(), mismatchDescription.ToString(), userMessage);
throw EqualException.ForMismatchedValues(description.ToString(), mismatchDescription.ToString(), userMessage);
}
}
}
20 changes: 0 additions & 20 deletions src/NHamcrest.XUnit/MatchException.cs

This file was deleted.

10 changes: 5 additions & 5 deletions src/NHamcrest.XUnit/NHamcrest.XUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Copyright>Copyright © 2023</Copyright>
<Version Condition="'$(VersionSuffix)' == ''">3.2.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">3.2.0-$(VersionSuffix)</Version>
<Version Condition="'$(VersionSuffix)' == ''">3.3.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">3.3.0-$(VersionSuffix)</Version>
<Description>Adapter for xunit for using NHamcrest library</Description>
<Authors>Graham Hay, Algirdas Lašas, Constantin Tews</Authors>
<PackageLicenseUrl>https://github.com/nhamcrest/NHamcrest/blob/master/LICENCE.txt</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/nhamcrest/NHamcrest</PackageProjectUrl>
<PackageTags>unittesting hamcrest matcher test</PackageTags>
<AssemblyVersion>3.2.0.0</AssemblyVersion>
<FileVersion>3.2.0.0</FileVersion>
<AssemblyVersion>3.3.0.0</AssemblyVersion>
<FileVersion>3.3.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.assert" Version="2.4.2" />
<PackageReference Include="xunit.assert" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest\NHamcrest.csproj" />
Expand Down
8 changes: 4 additions & 4 deletions src/NHamcrest/NHamcrest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Copyright>Copyright © 2023</Copyright>
<Version Condition="'$(VersionSuffix)' == ''">3.2.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">3.2.0-$(VersionSuffix)</Version>
<Version Condition="'$(VersionSuffix)' == ''">3.3.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">3.3.0-$(VersionSuffix)</Version>
<Description>.NET port of Hamcrest, a matcher library with some extra matchers</Description>
<Authors>Graham Hay, Algirdas Lašas, Constantin Tews</Authors>
<PackageLicenseUrl>https://github.com/nhamcrest/NHamcrest/blob/master/LICENCE.txt</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/nhamcrest/NHamcrest</PackageProjectUrl>
<PackageTags>unittesting hamcrest matcher test</PackageTags>
<AssemblyVersion>3.2.0.0</AssemblyVersion>
<FileVersion>3.2.0.0</FileVersion>
<AssemblyVersion>3.3.0.0</AssemblyVersion>
<FileVersion>3.3.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;1591</NoWarn>
Expand Down

0 comments on commit 38d4eb6

Please sign in to comment.