Snapper icon indicating copy to clipboard operation
Snapper copied to clipboard

feat: support NUnit v4

Open viceice opened this issue 1 year ago • 8 comments

This change should now support NUnit v3 and v4, so would be nice to backport to Snapper v2.

  • closes #106
  • https://github.com/nunit/nunit/blob/68d994772d10de54ac960ea8379ee966a3293083/src/NUnitFramework/framework/Constraints/Constraint.cs#L60

viceice avatar Feb 07 '24 08:02 viceice

👋 Thanks for the PR!

There are two changes I'd like if you are still willing to contribute!

  1. The build is failing, so that will need fixing
  2. Update Snapper.TestFrameworkSupport.Tests and Snapper.Nunit.Tests to use Nunit 4.

Let me know if you are wanting to make these changes or if not I'd be happy to put up a PR to support Nunit 4!

theramis avatar Feb 11 '24 19:02 theramis

I'll update my PR soon

viceice avatar Feb 12 '24 07:02 viceice

Shouldn't we also add an nunit v3 test to ensure compabillity?

viceice avatar Feb 12 '24 08:02 viceice

The failed tests are unrelated to my changes. i also see them failing locally when running the tests a second time. then two snapshots are changed (at least on windows)

viceice avatar Feb 12 '24 08:02 viceice

diff --git a/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerClassTests.json b/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerClassTests.json
index 2086477..786ffda 100644
--- a/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerClassTests.json
+++ b/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerClassTests.json
@@ -6,7 +6,8 @@
     "TestValue": "isUpdated"
   },
   "SnapshotsDoNotMatch_SnapshotsDoNotMatchException_IsThrown": {
-    "TestValue": "value"
+    "TestValue": "value",
+    "NewValue": "newvalue"
   },
   "TheorySnapshotsMatch": {
     "1": {
@@ -18,5 +19,8 @@
     "3": {
       "TestValue": 3
     }
+  },
+  "SnapshotDoesNotExist_And_IsCiEnv_SnapshotDoesNotExistException_IsThrown": {
+    "TestValue": "value"
   }
 }
\ No newline at end of file
diff --git a/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerMethodTests_SnapshotsDoNotMatch_SnapshotsDoNotMatchException_IsThrown.json b/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerMethodTests_SnapshotsDoNotMatch_SnapshotsDoNotMatchException_IsThrown.json
index a23fc7f..c27a153 100644
--- a/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerMethodTests_SnapshotsDoNotMatch_SnapshotsDoNotMatchException_IsThrown.json
+++ b/project/Tests/Snapper.Tests/_snapshots/SnapperSnapshotsPerMethodTests_SnapshotsDoNotMatch_SnapshotsDoNotMatchException_IsThrown.json
@@ -1,3 +1,4 @@
 {
-  "TestValue": "value"
+  "TestValue": "value",
+  "NewValue": "newvalue"
 }
\ No newline at end of file

viceice avatar Feb 12 '24 08:02 viceice

Hello, any plans to release it?

PavelFischerCoupa avatar May 06 '24 08:05 PavelFischerCoupa

@theramis, how can this PR be unstuck, please? If tests are failing, but @viceice is saying they are unrelated to the PR, then this change seems likely to remain in limbo for all time as there's no way forward.

DavidArno avatar May 22 '24 15:05 DavidArno