fortiumpartners/ai-mesh
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.
5 skills
This skill executes and generates xUnit tests for C#/.NET projects, integrates FluentAssertions and Moq for robust unit testing.
This skill executes and generates RSpec tests for Ruby projects, including let bindings and before hooks, with mocking support.
This skill generates and runs ExUnit tests for Elixir projects, supporting describe blocks, setup callbacks, and async testing to verify behavior.
This skill executes and generates pytest tests for Python projects, including fixtures, parametrization, and mocking support to boost test quality.
This skill automatically detects test frameworks in a project by analyzing manifests, configs, and directories to guide test generation and execution.