From 7e508d10bd3716f6a6c60ca4dc9ca1ceb4476407 Mon Sep 17 00:00:00 2001 From: "Dag H. Baardsen" Date: Thu, 30 Nov 2023 21:49:59 +0100 Subject: [PATCH 1/5] Added support for .NET 8, Nuget 4.0 --- .../Snapshooter.Benchmarks.csproj | 4 ++-- global.json | 2 +- src/Dependencies.props | 2 +- src/Snapshooter.Json/Snapshooter.Json.csproj | 4 ++++ .../Snapshooter.MSTest.csproj | 8 ++++++-- src/Snapshooter.NUnit/NUnitAssert.cs | 2 +- .../Snapshooter.NUnit.csproj | 6 +++++- .../Snapshooter.Xunit.csproj | 8 ++++++-- src/Snapshooter/Snapshooter.csproj | 6 +++++- test/Dependencies.props | 2 +- .../Snapshooter.Environment.Tests.csproj | 15 +++++++++++++++ .../Snapshooter.Json.Tests.csproj | 15 +++++++++++++++ .../Snapshooter.MSTest.Tests.csproj | 19 +++++++++++++++++-- .../NUnitAssertTests.cs | 2 +- .../Snapshooter.NUnit.Tests.csproj | 19 +++++++++++++++++-- test/Snapshooter.NUnit.Tests/SnapshotTests.cs | 6 +++--- .../Snapshooter.Tests.Data.csproj | 15 +++++++++++++++ .../Snapshooter.Tests.csproj | 15 +++++++++++++++ .../Snapshooter.Xunit.Tests.csproj | 15 +++++++++++++++ 19 files changed, 145 insertions(+), 20 deletions(-) diff --git a/benchmark/Snapshooter.Benchmarks/Snapshooter.Benchmarks.csproj b/benchmark/Snapshooter.Benchmarks/Snapshooter.Benchmarks.csproj index 31072cc..d2d5126 100644 --- a/benchmark/Snapshooter.Benchmarks/Snapshooter.Benchmarks.csproj +++ b/benchmark/Snapshooter.Benchmarks/Snapshooter.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable enable false @@ -10,7 +10,7 @@ - + diff --git a/global.json b/global.json index 1bf76a5..c19a2e0 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "latestMinor" } } diff --git a/src/Dependencies.props b/src/Dependencies.props index bcdfbfb..ecaf7ef 100644 --- a/src/Dependencies.props +++ b/src/Dependencies.props @@ -1,5 +1,5 @@ - netstandard2.0;netcoreapp3.1;net6.0;net7.0 + net6.0;net7.0;net8.0 diff --git a/src/Snapshooter.Json/Snapshooter.Json.csproj b/src/Snapshooter.Json/Snapshooter.Json.csproj index d3328df..f5d22bc 100644 --- a/src/Snapshooter.Json/Snapshooter.Json.csproj +++ b/src/Snapshooter.Json/Snapshooter.Json.csproj @@ -16,4 +16,8 @@ + + + + diff --git a/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj b/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj index 9bf3cf8..59d51a3 100644 --- a/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj +++ b/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj @@ -13,12 +13,16 @@ - - + + + + + + diff --git a/src/Snapshooter.NUnit/NUnitAssert.cs b/src/Snapshooter.NUnit/NUnitAssert.cs index 95d1f25..3b16481 100644 --- a/src/Snapshooter.NUnit/NUnitAssert.cs +++ b/src/Snapshooter.NUnit/NUnitAssert.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using NUnit.Framework; using Snapshooter.Core; using NAssert = NUnit.Framework.Assert; diff --git a/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj b/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj index 2d6ca11..29bbf92 100644 --- a/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj +++ b/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj @@ -14,11 +14,15 @@ - + + + + + diff --git a/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj b/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj index 2c6c674..b1d3f48 100644 --- a/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj +++ b/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj @@ -13,12 +13,16 @@ - - + + + + + + diff --git a/src/Snapshooter/Snapshooter.csproj b/src/Snapshooter/Snapshooter.csproj index a6b1936..f79f693 100644 --- a/src/Snapshooter/Snapshooter.csproj +++ b/src/Snapshooter/Snapshooter.csproj @@ -14,7 +14,11 @@ - + + + + + diff --git a/test/Dependencies.props b/test/Dependencies.props index cf8ac7c..b203785 100644 --- a/test/Dependencies.props +++ b/test/Dependencies.props @@ -1,5 +1,5 @@ - netcoreapp3.1;net6.0;net7.0 + net6.0;net7.0;net8.0 diff --git a/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj b/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj index cc5bdc1..51df213 100644 --- a/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj +++ b/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj @@ -11,5 +11,20 @@ + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj b/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj index 354a690..1fcc1da 100644 --- a/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj +++ b/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj @@ -18,4 +18,19 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj b/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj index c2f8dd5..e462a44 100644 --- a/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj +++ b/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj @@ -8,8 +8,8 @@ - - + + @@ -17,4 +17,19 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/test/Snapshooter.NUnit.Tests/NUnitAssertTests.cs b/test/Snapshooter.NUnit.Tests/NUnitAssertTests.cs index 8d01732..15a6b24 100644 --- a/test/Snapshooter.NUnit.Tests/NUnitAssertTests.cs +++ b/test/Snapshooter.NUnit.Tests/NUnitAssertTests.cs @@ -28,4 +28,4 @@ public void Assert_AssertUnequalText_ThrowsEqualException() Assert.That(action, Throws.TypeOf()); } } -} \ No newline at end of file +} diff --git a/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj b/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj index 61ebced..064f9e0 100644 --- a/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj +++ b/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj @@ -8,8 +8,8 @@ - - + + @@ -17,4 +17,19 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/test/Snapshooter.NUnit.Tests/SnapshotTests.cs b/test/Snapshooter.NUnit.Tests/SnapshotTests.cs index 5b0feb0..d593bd8 100644 --- a/test/Snapshooter.NUnit.Tests/SnapshotTests.cs +++ b/test/Snapshooter.NUnit.Tests/SnapshotTests.cs @@ -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 diff --git a/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj b/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj index 9fd1ace..1e8d9a7 100644 --- a/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj +++ b/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj @@ -11,4 +11,19 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/test/Snapshooter.Tests/Snapshooter.Tests.csproj b/test/Snapshooter.Tests/Snapshooter.Tests.csproj index 6bb2883..9f1389d 100644 --- a/test/Snapshooter.Tests/Snapshooter.Tests.csproj +++ b/test/Snapshooter.Tests/Snapshooter.Tests.csproj @@ -17,4 +17,19 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj b/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj index 8c825d3..76b9676 100644 --- a/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj +++ b/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj @@ -43,4 +43,19 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + From 068b28a767671a68e0e2ee619566cd103b172c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20H=C3=A5kon?= Date: Thu, 7 Dec 2023 10:19:28 +0100 Subject: [PATCH 2/5] Fixes after peer review --- src/Dependencies.props | 2 +- src/Package.props | 2 +- src/Snapshooter.Json/Snapshooter.Json.csproj | 4 ---- .../Snapshooter.MSTest.csproj | 8 ++------ .../Snapshooter.NUnit.csproj | 4 ---- .../Snapshooter.Xunit.csproj | 8 ++------ src/Snapshooter/Snapshooter.csproj | 4 ---- .../Snapshooter.Environment.Tests.csproj | 19 ++----------------- .../Snapshooter.Json.Tests.csproj | 15 --------------- .../Snapshooter.MSTest.Tests.csproj | 15 --------------- .../Snapshooter.NUnit.Tests.csproj | 15 --------------- .../Snapshooter.Tests.Data.csproj | 15 --------------- .../Snapshooter.Tests.csproj | 15 --------------- .../Snapshooter.Xunit.Tests.csproj | 17 +---------------- 14 files changed, 9 insertions(+), 134 deletions(-) diff --git a/src/Dependencies.props b/src/Dependencies.props index ecaf7ef..900cefc 100644 --- a/src/Dependencies.props +++ b/src/Dependencies.props @@ -1,5 +1,5 @@ - net6.0;net7.0;net8.0 + netstandard2.0;net6.0;net7.0;net8.0 diff --git a/src/Package.props b/src/Package.props index 0cef9fc..f3a7197 100644 --- a/src/Package.props +++ b/src/Package.props @@ -26,7 +26,7 @@ - + diff --git a/src/Snapshooter.Json/Snapshooter.Json.csproj b/src/Snapshooter.Json/Snapshooter.Json.csproj index f5d22bc..d3328df 100644 --- a/src/Snapshooter.Json/Snapshooter.Json.csproj +++ b/src/Snapshooter.Json/Snapshooter.Json.csproj @@ -16,8 +16,4 @@ - - - - diff --git a/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj b/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj index 59d51a3..9bf3cf8 100644 --- a/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj +++ b/src/Snapshooter.MSTest/Snapshooter.MSTest.csproj @@ -13,16 +13,12 @@ - - + + - - - - diff --git a/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj b/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj index 29bbf92..d2d8992 100644 --- a/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj +++ b/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj @@ -21,8 +21,4 @@ - - - - diff --git a/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj b/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj index b1d3f48..2c6c674 100644 --- a/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj +++ b/src/Snapshooter.Xunit/Snapshooter.Xunit.csproj @@ -13,16 +13,12 @@ - - + + - - - - diff --git a/src/Snapshooter/Snapshooter.csproj b/src/Snapshooter/Snapshooter.csproj index f79f693..28845fc 100644 --- a/src/Snapshooter/Snapshooter.csproj +++ b/src/Snapshooter/Snapshooter.csproj @@ -17,8 +17,4 @@ - - - - diff --git a/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj b/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj index 51df213..408efc1 100644 --- a/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj +++ b/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj @@ -1,30 +1,15 @@ - + Snapshooter.Environment.Tests Snapshooter.Environment.Tests true - + - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj b/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj index 1fcc1da..354a690 100644 --- a/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj +++ b/test/Snapshooter.Json.Tests/Snapshooter.Json.Tests.csproj @@ -18,19 +18,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj b/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj index e462a44..8f413d2 100644 --- a/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj +++ b/test/Snapshooter.MSTest.Tests/Snapshooter.MSTest.Tests.csproj @@ -17,19 +17,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj b/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj index 064f9e0..0adb60f 100644 --- a/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj +++ b/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj @@ -17,19 +17,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj b/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj index 1e8d9a7..9fd1ace 100644 --- a/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj +++ b/test/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj @@ -11,19 +11,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/test/Snapshooter.Tests/Snapshooter.Tests.csproj b/test/Snapshooter.Tests/Snapshooter.Tests.csproj index 9f1389d..6bb2883 100644 --- a/test/Snapshooter.Tests/Snapshooter.Tests.csproj +++ b/test/Snapshooter.Tests/Snapshooter.Tests.csproj @@ -17,19 +17,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - diff --git a/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj b/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj index 76b9676..cf12117 100644 --- a/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj +++ b/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj @@ -11,7 +11,7 @@ - + @@ -43,19 +43,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - From dc32d2ae19211123297d0f219ddf59cb03206c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20H=C3=A5kon?= Date: Thu, 7 Dec 2023 10:27:03 +0100 Subject: [PATCH 3/5] Fix netandard2.0 using earlier versions of NUnit --- src/Snapshooter.NUnit/Snapshooter.NUnit.csproj | 9 ++++++++- .../Snapshooter.NUnit.Tests.csproj | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj b/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj index d2d8992..0eaa945 100644 --- a/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj +++ b/src/Snapshooter.NUnit/Snapshooter.NUnit.csproj @@ -12,9 +12,16 @@ false + + + + + + + + - diff --git a/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj b/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj index 0adb60f..5484b7c 100644 --- a/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj +++ b/test/Snapshooter.NUnit.Tests/Snapshooter.NUnit.Tests.csproj @@ -7,8 +7,15 @@ true + + + + + + + + - From b3ce9b733d9d77dbb96605238bb2cece8705751a Mon Sep 17 00:00:00 2001 From: Florian Rohrer Date: Wed, 3 Jan 2024 11:49:16 +0100 Subject: [PATCH 4/5] add dotnet 8 to pipelines --- .github/workflows/pull-request.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 89c13ec..5a73165 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -16,6 +16,7 @@ jobs: dotnet-version: | 6 7 + 8 - name: Build, Test and Sonar uses: swisslife-oss/actions/pull-request@main with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f4889e..b45eb56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,7 @@ jobs: dotnet-version: | 6 7 + 8 - name: Restore tools run: dotnet tool restore - name: Build, Test and Sonar From 342d6d95ee44ad342921f5762763ea59af08a987 Mon Sep 17 00:00:00 2001 From: Florian Rohrer Date: Wed, 3 Jan 2024 13:20:35 +0100 Subject: [PATCH 5/5] remove unnecessary changes --- src/Snapshooter.NUnit/NUnitAssert.cs | 2 +- .../Snapshooter.Environment.Tests.csproj | 4 ++-- test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Snapshooter.NUnit/NUnitAssert.cs b/src/Snapshooter.NUnit/NUnitAssert.cs index 3b16481..95d1f25 100644 --- a/src/Snapshooter.NUnit/NUnitAssert.cs +++ b/src/Snapshooter.NUnit/NUnitAssert.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using NUnit.Framework; using Snapshooter.Core; using NAssert = NUnit.Framework.Assert; diff --git a/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj b/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj index 408efc1..cc5bdc1 100644 --- a/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj +++ b/test/Snapshooter.Environment.Tests/Snapshooter.Environment.Tests.csproj @@ -1,12 +1,12 @@ - + Snapshooter.Environment.Tests Snapshooter.Environment.Tests true - + diff --git a/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj b/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj index cf12117..8c825d3 100644 --- a/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj +++ b/test/Snapshooter.Xunit.Tests/Snapshooter.Xunit.Tests.csproj @@ -11,7 +11,7 @@ - +