Skip to content

Commit

Permalink
Merge pull request #10 from CaptnCodr/feature/NET6-Upgrade
Browse files Browse the repository at this point in the history
.NET6 Upgrade
  • Loading branch information
CaptnCodr authored Aug 5, 2022
2 parents 36f62a9 + 18b9989 commit e835f27
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 46 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.0.1.{build}-{branch}
version: 3.0.0.{build}-{branch}
configuration:
- Debug
- Release
Expand Down
4 changes: 2 additions & 2 deletions src/NHamcrest.NUnit.Examples/NHamcrest.NUnit.Examples.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.6.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest.NUnit\NHamcrest.NUnit.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions src/NHamcrest.NUnit/NHamcrest.NUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.6.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest\NHamcrest.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions src/NHamcrest.Tests/Core/AllOfTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public void Match_if_all_matchers_succeed()
{
var matcher = Matches.AllOf(_successfulMatcher, _successfulMatcher);

Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));
}

[Fact]
public void No_match_if_any_matcher_fails()
{
var matcher = Matches.AllOf(_failingMatcher, _successfulMatcher);

Assert.Equal(false, matcher.Matches(""));
Assert.False(matcher.Matches(""));
}

[Fact]
Expand Down
8 changes: 4 additions & 4 deletions src/NHamcrest.Tests/Core/AnyOfTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ public class AnyOfTests
public void Match_if_any_matchers_succeed()
{
var matcher = Matches.AnyOf(_successfulMatcher, _failingMatcher);
Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));

matcher = Matches.AnyOf(new List<IMatcher<string>> { _failingMatcher, _successfulMatcher });
Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));
}

[Fact]
public void No_match_if_all_matchers_fail()
{
var matcher = Matches.AnyOf(_failingMatcher, _failingMatcher);

Assert.Equal(false, matcher.Matches(""));
Assert.False(matcher.Matches(""));
}

[Fact]
public void Shortcut_matching_when_matcher_succeeds()
{
var matcher = Matches.AnyOf(_successfulMatcher, _explodingMatcher);
Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));
}

[Fact]
Expand Down
12 changes: 6 additions & 6 deletions src/NHamcrest.Tests/Core/CombinableMatcherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@ public void Both_returns_match_if_both_succeed()
{
var matcher = Matches.Both(new CombinableMatcher<string>(_successfulMatcher).And(_successfulMatcher));

Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));
}

[Fact]
public void Both_returns_no_match_if_either_fails()
{
var matcher = Matches.Both(new CombinableMatcher<string>(_successfulMatcher).And(_failingMatcher));

Assert.Equal(false, matcher.Matches(""));
Assert.False(matcher.Matches(""));
}

[Fact]
public void Either_returns_match_if_any_succeeds()
{
var matcher = Matches.Either(new CombinableMatcher<string>(_successfulMatcher).Or(_successfulMatcher));
Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));

matcher = Matches.Either(new CombinableMatcher<string>(_successfulMatcher).Or(_failingMatcher));
Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));

matcher = Matches.Either(new CombinableMatcher<string>(_failingMatcher).Or(_successfulMatcher));
Assert.Equal(true, matcher.Matches(""));
Assert.True(matcher.Matches(""));
}

[Fact]
public void Either_returns_no_match_if_all_fail()
{
var matcher = Matches.Either(new CombinableMatcher<string>(_failingMatcher).And(_failingMatcher));

Assert.Equal(false, matcher.Matches(""));
Assert.False(matcher.Matches(""));
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion src/NHamcrest.Tests/DescriptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void None_returns_a_null_description()
{
var nullDescription = Description.None;

Assert.IsType(typeof(NullDescription), nullDescription);
Assert.IsType<NullDescription>(nullDescription);
}

[Fact]
Expand Down
10 changes: 5 additions & 5 deletions src/NHamcrest.Tests/FeatureMatcherDescriptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public void FeatureMatcherGeneratesCorrectDescriptionForAllProperties(int intVal
[InlineData(1, "foo", 2, "qux", "failed to match one", "boom!")]
[InlineData(3, "bar", 17, "baz", "the world exploded", "stack overflow")]
public void FeatureMatcherGeneratesCorrectMismatchDescriptionForAllFailedProperties(
int intVal,
string stringVal,
int mismatchedIntVal,
string mismatchedStringVal,
string mismatchedIntDescription,
int intVal,
string stringVal,
int mismatchedIntVal,
string mismatchedStringVal,
string mismatchedIntDescription,
string mismatchedStringDescription)
{
var sut = Describe.Object<SimpleFlatClass>()
Expand Down
17 changes: 10 additions & 7 deletions src/NHamcrest.Tests/NHamcrest.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<Version>2.0.0</Version>
<TargetFramework>net6.0</TargetFramework>
<Version>3.0.0</Version>
<Description />
</PropertyGroup>
<ItemGroup>
<Compile Remove="FeatureMatcherTests.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="Castle.Core" Version="4.0.0" />
<PackageReference Include="Moq" Version="4.7.1" />
<PackageReference Include="Microsoft.NET.TEST.Sdk" Version="15.0.0"/>
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Castle.Core" Version="5.1.0" />
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="Microsoft.NET.TEST.Sdk" Version="17.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest.XUnit\NHamcrest.XUnit.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions src/NHamcrest.XUnit.Examples/NHamcrest.XUnit.Examples.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest.XUnit\NHamcrest.XUnit.csproj" />
Expand Down
14 changes: 7 additions & 7 deletions src/NHamcrest.XUnit/NHamcrest.XUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.5;net451</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Copyright>Copyright © 2017</Copyright>
<Version Condition="'$(VersionSuffix)' == ''">2.0.1</Version>
<Version Condition="'$(VersionSuffix)' != ''">2.0.1-$(VersionSuffix)</Version>
<Copyright>Copyright © 2022</Copyright>
<Version Condition="'$(VersionSuffix)' == ''">3.0.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">0.0.0-$(VersionSuffix)</Version>
<Description>Adapter for xunit for using NHamcrest library</Description>
<Authors>Graham Hay, Algirdas Lašas</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>2.0.1.0</AssemblyVersion>
<FileVersion>2.0.1.0</FileVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.assert" Version="[2.2,3)" />
<PackageReference Include="xunit.assert" Version="2.4.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHamcrest\NHamcrest.csproj" />
Expand Down
12 changes: 6 additions & 6 deletions src/NHamcrest/NHamcrest.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.5;net451</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Copyright>Copyright © 2017</Copyright>
<Version Condition="'$(VersionSuffix)' == ''">2.0.1</Version>
<Version Condition="'$(VersionSuffix)' != ''">2.0.1-$(VersionSuffix)</Version>
<Copyright>Copyright © 2022</Copyright>
<Version Condition="'$(VersionSuffix)' == ''">3.0.0</Version>
<Version Condition="'$(VersionSuffix)' != ''">3.0.0-$(VersionSuffix)</Version>
<Description>.NET port of Hamcrest, a matcher library with some extra matchers</Description>
<Authors>Graham Hay, Algirdas Lašas</Authors>
<Company />
<Product />
<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>2.0.1.0</AssemblyVersion>
<FileVersion>2.0.1.0</FileVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;1591</NoWarn>
Expand Down

0 comments on commit e835f27

Please sign in to comment.