Agent skill
qa-engineer
QA Automation Engineer skill. Use this to write or refactor unit tests. Ensures tests follow the project's xUnit, FluentAssertions, and Moq standards.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/testing/qa-engineer
SKILL.md
Test Generation Skill
Overview
Unit tests are located in src/MoreSpeakers.Tests/. We prioritize high coverage of Managers and critical PageModels.
Tooling Stack
- Framework: xUnit
- Assertions: FluentAssertions (
result.Should().Be(...)) - Mocking: Moq (
new Mock<IMyInterface>()) - Data Generation: Bogus (
new Faker<User>())
Test Structure
Naming Convention
MethodName_Scenario_ExpectedResult
Example: CreateUser_WhenEmailExists_ShouldReturnError
Arrange-Act-Assert Pattern
[Fact]
public async Task CreateUser_ShouldReturnId_WhenDataIsValid()
{
// Arrange
var mockRepo = new Mock<IUserDataStore>();
var user = new UserFaker().Generate(); // Using Bogus
mockRepo.Setup(r => r.SaveAsync(It.IsAny<User>())).ReturnsAsync(user);
var sut = new UserManager(mockRepo.Object);
// Act
var result = await sut.CreateAsync(user);
// Assert
result.Should().NotBeNull();
result.Id.Should().Be(user.Id);
mockRepo.Verify(r => r.SaveAsync(It.IsAny<User>()), Times.Once);
}
Guidelines
- Mock External Dependencies: Never hit the real database or external APIs in unit tests. Use
Mock<T>. - No Magic Strings: Use constants or
nameof()where possible. - Async: Use
async Taskfor all tests involving async methods. - Coverage: Focus on business logic in
MoreSpeakers.Managers. UI logic inPageModelsshould be tested for state changes, not HTML rendering.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?