Skip to content

Conversation

@SeanKilleen
Copy link
Member

@SeanKilleen SeanKilleen commented Aug 31, 2025

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.

@SeanKilleen
Copy link
Member Author

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.

@SeanKilleen SeanKilleen marked this pull request as draft August 31, 2025 14:59
[Test]
public void EqualConstraint_Numerics()
{
Assert.That(2 + 2, Is.EqualTo(4.0));
Copy link
Member Author

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.

Copy link
Member

@OsirisTerje OsirisTerje left a 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 ?

@OsirisTerje OsirisTerje requested a review from Copilot August 31, 2025 19:47
Copy link
Contributor

Copilot AI left a 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.

@SeanKilleen SeanKilleen marked this pull request as ready for review August 31, 2025 21:16
@SeanKilleen SeanKilleen enabled auto-merge (squash) August 31, 2025 21:35
@SeanKilleen SeanKilleen merged commit ecd21e7 into master Aug 31, 2025
6 checks passed
@SeanKilleen SeanKilleen deleted the Convert-docs-to-snippets branch August 31, 2025 21:35
github-actions bot pushed a commit that referenced this pull request Aug 31, 2025
* 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
@SeanKilleen
Copy link
Member Author

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)]
Copy link
Member

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

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants