Repository navigation
Expand Assert.Ignore docs: behavior, Ignore vs Skip, NUnit 5 warning interaction, Test Explorer mapping, conditional ignore - #1305
Merged
Conversation
…ional ignore Rewrites the Assert.Ignore page to cover what the call does (throws IgnoreException, ends the test, Skipped:Ignored), where it can be called from and what each site ignores, how Ignored, Inconclusive, Skipped and Warning differ and how the VS Test Adapter maps them (MapWarningTo), the NUnit 5 change that keeps earlier warnings in the result message, an Ignore.If helper and TestCaseData.Ignore for conditional ignoring, and the attribute-based alternatives. Adds matching notes to Assert.Inconclusive, Assert.Pass and Warnings, and a compiled snippet file whose tests verify the documented behavior. Behavior verified against NUnit 5.0.0 and NUnit 4.4.0. Closes #1295 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
📖 Docs preview removed because this PR was closed. |
OsirisTerje
requested changes
Oct 25, 2026
- Mention the common use of ignoring to park a test that is under development, pointing to the Ignore attribute for that case - Document the Ignore attribute on a fixture, with a snippet, and the "OneTimeSetUp: <reason>" message its tests carry - Add the suggested "under development" row to the outcome table - Correct the dotnet test description: the reason is only printed at normal verbosity or above; include sample output for both levels Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 26, 2026
…interaction, Test Explorer mapping, conditional ignore (#1305) * Expand Assert.Ignore docs: behavior, Ignore vs Skip, warnings, conditional ignore Rewrites the Assert.Ignore page to cover what the call does (throws IgnoreException, ends the test, Skipped:Ignored), where it can be called from and what each site ignores, how Ignored, Inconclusive, Skipped and Warning differ and how the VS Test Adapter maps them (MapWarningTo), the NUnit 5 change that keeps earlier warnings in the result message, an Ignore.If helper and TestCaseData.Ignore for conditional ignoring, and the attribute-based alternatives. Adds matching notes to Assert.Inconclusive, Assert.Pass and Warnings, and a compiled snippet file whose tests verify the documented behavior. Behavior verified against NUnit 5.0.0 and NUnit 4.4.0. Closes #1295 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Address review feedback on Assert.Ignore docs - Mention the common use of ignoring to park a test that is under development, pointing to the Ignore attribute for that case - Document the Ignore attribute on a fixture, with a snippet, and the "OneTimeSetUp: <reason>" message its tests carry - Add the suggested "under development" row to the outcome table - Correct the dotnet test description: the reason is only printed at normal verbosity or above; include sample output for both levels Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> 87eef32
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.
Closes #1295
What changed
Assert.Ignorepage rewritten from ten lines to a full reference:IgnoreException, ends the test immediately, result isSkipped:Ignored. Notes that it can be called from a helper, must not be swallowed bycatch (Exception), and is an error inside a multiple assert block.SetUp,OneTimeSetUp,SetUpFixture), including theOneTimeSetUp: SetUp : <reason>message on child tests and that teardown still runs.MapWarningTo), with a link to the adapter setting. Explains whydotnet testsummary counts can look off.Assert.InconclusiveandAssert.Pass.Ignore.If/Ignore.Unlesshelper (from Ignore.If nunit#4373),TestCaseData.Ignore(...).Until(...), and the attribute-based alternatives to prefer when the condition is known up front.Assert.InconclusiveandAssert.Passget a short note on throwing, multiple-assert blocks and the NUnit 5 warning behavior, linking to the new sections.Warnings.mdgets a new section on warnings followed byAssert.Ignore/Assert.Inconclusive/Assert.Pass, cross-linking to theAssert.Ignorepage.New snippet file
AssertIgnoreExamples.csbacks every example on the page. Its tests run as part of the snippet suite; the examples that callAssert.Ignoreshow up as ignored (expected), and two hidden tests assert thatIgnoreExceptionis thrown and that use insideEnterMultipleScopeis an error.Verification
asserts="1"; NUnit 4 reports only the ignore reason withasserts="0".TestConverter.GetTestOutcomeandNUnitTestEvent.IsIgnoredin nunit3-vs-adapter.dotnet teston the snippet project,markdownlint-cli2,cspellanddocfx docs/docfx.jsonall pass; all new anchors and xrefs resolve in the built HTML.🤖 Generated with Claude Code