Repository navigation
Test hygiene: enforce NUnit1032, ban the classic assert model, fix SchedulerFactoryObject.Dispose - #386
Merged
Conversation
…initialized Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
…nitRunner to NUnit projects test/Directory.Build.targets drops nunit.framework.legacy.dll from the compiler's references, which covers ClassicAssert, StringAssert, CollectionAssert, FileAssert, DirectoryAssert and the Assert.AreEqual extension members. EnableNUnitRunner is switched off for projects that set UseNUnit to false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
Removes the test/.editorconfig override that held NUnit1032 at suggestion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk Signed-off-by: Marko Lahma <marko.lahma@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to the NUnit 5 / Microsoft.Testing.Platform migration (#383).
SchedulerFactoryObject.Disposeno longer throws a NullReferenceException on a factory that was never initialized; it returns early when there is no scheduler. A factory that is only half initialized still gets its scheduler shut down. New tests:TestDispose_NotInitialized, which failed before the fix, andTestDispose_Initialized_ShutsDownScheduler. This is the onlysrc/change.[TearDown].#pragmas remain:WebApplicationTests.host, a sharedAspFixtureHostreleased throughReleaseInstance, and the static queue shared bySimpleMessageListenerContainerTests.test/.editorconfigheld only the suggestion override, so it is deleted.test/.test/Directory.Build.targetsremovesnunit.framework.legacy.dllfrom the compile references. The assembly still goes to the output, because NUnit's runtime needs it.ClassicAssert,StringAssert,CollectionAssert,FileAssert,DirectoryAssert, theAssert.AreEqual-style extension members and theNUnit.Framework.Legacynamespace all fail to compile, on both TFMs.FileAssert,DirectoryAssert, the extension members and sixClassicAssertmembers, and raising them all to error brings in about 1,700 unrelated errors.ClassicAssertinherits from the base class it shares withAssert.AbstractAopProxyTests.Equalitynow compares two distinct proxies, both ways.PropertyValueTests.TestEqualsadds the cases that must not be equal.XmlObjectFactoryTestsnow asserts that factory-method arguments are passed through as the same objects.SimpleTest.cs(Assert.AreEqual(2, 1 + 1)) is deleted.EnableNUnitRunneris turned off for projects that setUseNUnit=false.Verification
./build.cmd Test --skip CompileExamples, net10.0 and net472. The only failure isFormatUsingDefaultson both TFMs, which depends on this machine's regional settings.Spring.Web.Tests was run again after rebasing onto Remove the ASMX web service exporter from Spring.Web #384: 192 passed, 8 skipped. The affected Core fixtures were also run again after the review fixes.
The integration projects (Data, NHibernate5, Quartz3, Web.Conversation) were compiled but not run. Their teardown changes are scoped to SetUp, and their existing DB cleanup still runs before the context is disposed. They should get a
--test-integration-datarun before release.spring-revieweraccepted it, with three small follow-ups that are now in the last commit.🤖 Generated with Claude Code
https://claude.ai/code/session_01LGkLQuAuUjvRjrU1AcTsmk