Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for .NET 8, NUnit 4.0 #188

Merged
merged 6 commits into from
Jan 5, 2024
Merged
Changes from 1 commit
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
Next Next commit
Added support for .NET 8, Nuget 4.0
Dag H. Baardsen committed Nov 30, 2023
commit 7e508d10bd3716f6a6c60ca4dc9ca1ceb4476407
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
2 changes: 1 addition & 1 deletion src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup Label="Framework Versions">
<ResourceProjectTargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0;net7.0</ResourceProjectTargetFrameworks>
daghsentinel marked this conversation as resolved.
Show resolved Hide resolved
<ResourceProjectTargetFrameworks>net6.0;net7.0;net8.0</ResourceProjectTargetFrameworks>
</PropertyGroup>
</Project>
4 changes: 4 additions & 0 deletions src/Snapshooter.Json/Snapshooter.Json.csproj
Original file line number Diff line number Diff line change
@@ -16,4 +16,8 @@
<ProjectReference Include="..\Snapshooter\Snapshooter.csproj" />
</ItemGroup>

<ItemGroup>
daghsentinel marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>

</Project>
8 changes: 6 additions & 2 deletions src/Snapshooter.MSTest/Snapshooter.MSTest.csproj
Original file line number Diff line number Diff line change
@@ -13,12 +13,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
daghsentinel marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Snapshooter\Snapshooter.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Snapshooter.NUnit/NUnitAssert.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using NUnit.Framework;
using Snapshooter.Core;
using NAssert = NUnit.Framework.Assert;
6 changes: 5 additions & 1 deletion src/Snapshooter.NUnit/Snapshooter.NUnit.csproj
Original file line number Diff line number Diff line change
@@ -14,11 +14,15 @@

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="4.0.0" />
daghsentinel marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Snapshooter\Snapshooter.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>

</Project>
8 changes: 6 additions & 2 deletions src/Snapshooter.Xunit/Snapshooter.Xunit.csproj
Original file line number Diff line number Diff line change
@@ -13,12 +13,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit.assert" Version="2.4.2" />
<PackageReference Include="xunit.core" Version="2.4.2" />
<PackageReference Include="xunit.assert" Version="2.6.2" />
daghsentinel marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="xunit.core" Version="2.6.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Snapshooter\Snapshooter.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion src/Snapshooter/Snapshooter.csproj
Original file line number Diff line number Diff line change
@@ -14,7 +14,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion test/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup Label="Framework Versions">
<TestProjectTargetFrameworks>netcoreapp3.1;net6.0;net7.0</TestProjectTargetFrameworks>
<TestProjectTargetFrameworks>net6.0;net7.0;net8.0</TestProjectTargetFrameworks>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -11,5 +11,20 @@
<ProjectReference Include="..\..\src\Snapshooter.Xunit\Snapshooter.Xunit.csproj" />
<ProjectReference Include="..\Snapshooter.Tests.Data\Snapshooter.Tests.Data.csproj" />
</ItemGroup>

daghsentinel marked this conversation as resolved.
Show resolved Hide resolved
<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.70" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj
Original file line number Diff line number Diff line change
@@ -18,4 +18,19 @@
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.70" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
19 changes: 17 additions & 2 deletions test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj
Original file line number Diff line number Diff line change
@@ -8,13 +8,28 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Snapshooter.MSTest\Snapshooter.MSTest.csproj" />
<ProjectReference Include="..\Snapshooter.Tests.Data\Snapshooter.Tests.Data.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.70" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion test/Snapshooter.NUnit.Tests/NUnitAssertTests.cs
Original file line number Diff line number Diff line change
@@ -28,4 +28,4 @@ public void Assert_AssertUnequalText_ThrowsEqualException()
Assert.That(action, Throws.TypeOf<AssertionException>());
}
}
}
}
19 changes: 17 additions & 2 deletions test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -8,13 +8,28 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="nunit" Version="4.0.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Snapshooter.NUnit\Snapshooter.NUnit.csproj" />
<ProjectReference Include="..\Snapshooter.Tests.Data\Snapshooter.Tests.Data.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.70" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions test/Snapshooter.NUnit.Tests/SnapshotTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using NUnit.Framework;
using Snapshooter.Tests.Data;

@@ -61,7 +61,7 @@ public void Match_TestMatchNewSingleSnapshot_ExpectedSnapshotHasBeenCreated()
Snapshot.Match(testPerson);

// assert
Assert.True(File.Exists(snapshotFileName));
Assert.That(File.Exists(snapshotFileName));
}

[TestCase(36, 189.45)]
@@ -129,7 +129,7 @@ public void Match_TestCaseMatchNewSingleSnapshot_ExpectedSnapshotHasBeenCreated(
Snapshot.Match(testPerson);

// assert
Assert.True(File.Exists(snapshotFileName));
Assert.That(File.Exists(snapshotFileName));
}

#endregion
15 changes: 15 additions & 0 deletions test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj
Original file line number Diff line number Diff line change
@@ -11,4 +11,19 @@
<EmbeddedResource Include="__testsources__\*" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.70" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions test/Snapshooter.Tests/Snapshooter.Tests.csproj
Original file line number Diff line number Diff line change
@@ -17,4 +17,19 @@
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.70" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -43,4 +43,19 @@
<Folder Include="MatchOptions\IncludeField\__snapshots__\__mismatch__\" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="FluentAssertions" Version="6.12.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Update="Moq" Version="4.20.70" />
<PackageReference Update="xunit" Version="2.6.2" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>