- Home
- Skills
- Fortiumpartners
- Ai Mesh
- Xunit Test
xunit-test_skill
- JavaScript
9
GitHub Stars
3
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill fortiumpartners/ai-mesh --skill xunit-test- generate-test.cs1.2 KB
- run-test.sh316 B
- SKILL.md528 B
Overview
This skill provides an xUnit test framework for C#/.NET projects that can generate and execute unit tests. It integrates FluentAssertions and Moq to produce readable, maintainable tests and supports running tests via dotnet test. Output is structured as JSON summarizing success, counts, and failure details.
How this skill works
The skill analyzes the specified source file and generates xUnit-compatible test code, using FluentAssertions for assertions and Moq for mocking dependencies where appropriate. It compiles and runs tests with dotnet, and returns a JSON result containing overall success, passed/failed/total counts, and an array of failures with messages and stack traces. Commands accept source, output, and description parameters to control generation and execution.
When to use it
- When you need quick, consistent unit tests for C# classes or methods.
- When adopting FluentAssertions and Moq for expressive assertions and isolated unit tests.
- When integrating automated test generation into CI pipelines or developer workflows.
- When you want machine-generated tests as a starting point for coverage and edge-case checks.
Best practices
- Review and refine generated tests; use them as a scaffold rather than final authoritative tests.
- Provide clear descriptions and method-level context to improve generated test intent.
- Run generated tests locally before adding them to source control to verify behavior and mock setups.
- Keep test projects and generation inputs under version control and include generation commands in docs or scripts.
Example use cases
- Generate tests for a Calculator.cs file to validate division, including division-by-zero behavior.
- Add generated tests to a CI job that runs dotnet test and fails the build on regressions.
- Create mocks for external dependencies using Moq when generating tests for classes with interfaces.
- Use FluentAssertions patterns in generated tests to make failure messages clearer during debugging.
FAQ
Test runs produce JSON with success, passed, failed, total, and a failures array containing detailed failure info.
How do I run generation and execution?
Use dotnet run to generate tests (specify --source, --output, --description) and dotnet test with --filter to execute specific tests.