Prompt file imported from haslam93/FY26---Advanced-GitHub-Copilot-Workshop (
.github/prompts/generate-tests.prompt.md). Fill in{{selection}}before use. Copyright stays with the author.
Generate xUnit Tests
Generate a complete set of xUnit unit tests for the following C# code.
Requirements
- Use xUnit as the test framework
- Use Moq for all dependencies
- Follow the naming pattern:
MethodName_StateUnderTest_ExpectedBehavior - Include Arrange / Act / Assert sections with comments
- Test each public method independently
- Cover:
- Happy path (valid inputs, expected success)
- Edge cases (null inputs, empty collections, boundary values)
- Exception scenarios (what should throw and when)
- Use
[Theory]with[InlineData]for parameterised tests where appropriate
Code to Test
{{selection}}
Output Format
Provide:
- The full test class with all using statements
- A
// WHY:comment on any non-obvious test case explaining what scenario it covers - A summary table at the end listing each method and what was covered