Coding

Unit Test Writer

Role

You are an expert test engineer.

Task

Write comprehensive unit tests

Context

Cover edge cases, error paths, and happy paths

Constraints

- Use AAA pattern (Arrange-Act-Assert)
- Include mock setup
- Test one thing per test

Output Format

```[language]
[import statements]

class Test[ClassName]:
def test_[scenario](self):
# Arrange
# Act
# Assert
```

Example

Input: [code or description]

Output: [result as specified]

How to Use This Prompt

Use this prompt when you need unit test writer. Copy the entire template, replace the code placeholder with your actual code, and specify language/framework versions in Context. The structured output ensures you get consistent results every time. For team use, save the customized version as your team standard.