feat: support NUnit v4
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
👋 Thanks for the PR!
There are two changes I'd like if you are still willing to contribute!
- The build is failing, so that will need fixing
- Update
Snapper.TestFrameworkSupport.TestsandSnapper.Nunit.Teststo 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!
I'll update my PR soon
Shouldn't we also add an nunit v3 test to ensure compabillity?
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)
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
Hello, any plans to release it?
@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.