-
Notifications
You must be signed in to change notification settings - Fork 161
Convert some docs to snippets #1065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This is a really awesome start -- we still need to go through and validate each sample and do some modifications to make things functional, but it's way easier to do that now that it's started. |
| [Test] | ||
| public void EqualConstraint_Numerics() | ||
| { | ||
| Assert.That(2 + 2, Is.EqualTo(4.0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore the analyzer alert here, for the sake of the docs.
OsirisTerje
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way to go!!!
I dont think I can beat Claude here, so perhaps just let CoPilot review it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR converts documentation examples from inline code blocks to structured code snippets referenced from dedicated C# files. This improves maintainability by making the examples testable and reusable across multiple documentation pages.
- Creates three new C# snippet files with comprehensive NUnit test examples
- Replaces inline code blocks in markdown files with snippet references
- Adds configuration for Claude Code development assistance
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/snippets/Snippets.NUnit/ConstraintExamples.cs | Comprehensive constraint examples with organized regions for documentation snippets |
| docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs | Classic assertion examples including CollectionAssert usage patterns |
| docs/snippets/Snippets.NUnit/AttributeExamples.cs | Test attribute examples covering setup, parametrization, and metadata attributes |
| docs/articles/nunit/writing-tests/constraints/*.md | Updated to reference code snippets instead of inline examples |
| docs/articles/nunit/writing-tests/attributes/*.md | Updated to reference code snippets instead of inline examples |
| docs/articles/nunit/writing-tests/assertions/classic-assertions/*.md | Updated to reference code snippets instead of inline examples |
| CLAUDE.md | Development guidance for Claude Code assistant |
| .claude/settings.local.json | Permissions configuration for Claude Code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
* Initial claude commit * formatting fixes * Allow claude to run build and test * Generate snippets from docs * allow build of docfx * Allow some more commands * Refer to the snippets * Add snippet to docs * fix sample name * use constraint example snippet * Use constraint example * fix constraint snippet * use snippet * Update docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs * R# cleanup * more R# cleanup * More R# cleanup * More R# cleanup * Use SetUpTearDownExample instead * Remove redundant snippet ecd21e7
|
Solid work, Claude. 🎉 I was able to feel ownership of this and adapt it as needed while having 90% of the tedium removed. |
| ClassicAssert.AreEqual(double.NegativeInfinity, double.NegativeInfinity); | ||
| ClassicAssert.AreEqual(double.NaN, double.NaN); | ||
| ``` | ||
| [!code-csharp[AreEqualExamples](~/snippets/Snippets.NUnit/ClassicAssertExamples.cs#AreEqualExamples)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SeanKilleen The same examples are shown on both line 20 and line 30.
The text might need adjusting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks, missed this 👍 I'll do a pass on the published site soon for inconsistencies.
Going to see how far Claude Code can take us on this journey. I've been curious about it and this seems like a possibly useful example -- automating a task that is a little tedious for a human.
Supports #427.