원클릭으로
write-unit-tests
Write comprehensive unit tests with proper setup, assertions, and coverage of happy paths, edge cases, and error scenarios
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Write comprehensive unit tests with proper setup, assertions, and coverage of happy paths, edge cases, and error scenarios
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Show a comprehensive project status dashboard: task queue, blocked items, session state, verification, and git status.
Run all verification gates (privacy scan, git cleanliness, git pushed) and report results.
Generate a QA/UAT test plan from product specifications and task definitions, covering acceptance testing, integration flows, and exploratory testing. Unit tests are out of scope (handled by write-unit-tests skill).
SOC 직업 분류 기준
| name | write-unit-tests |
| description | Write comprehensive unit tests with proper setup, assertions, and coverage of happy paths, edge cases, and error scenarios |
| auto_invoke | true |
Guide for writing effective unit tests that verify behavior and catch regressions.
[Fact]
public void MethodName_Scenario_ExpectedBehavior()
{
// Arrange - Set up test data and dependencies
var dependency = Substitute.For<IDependency>();
dependency.GetData().Returns(expectedData);
var sut = new SystemUnderTest(dependency);
// Act - Execute the behavior being tested
var result = sut.MethodUnderTest(input);
// Assert - Verify expected outcomes
result.Should().Be(expectedValue);
dependency.Received(1).GetData();
}
Use descriptive names that explain what's being tested:
MethodName_Scenario_ExpectedBehaviorMethodName_WhenCondition_ShouldDoSomethingMethodName_GivenInput_ReturnsExpectedOutputExamples:
Calculate_WithNegativeNumber_ThrowsArgumentExceptionProcessOrder_WhenInventoryInsufficient_ReturnsFailureResultFormatDate_GivenNull_ReturnsEmptyString// Good - Mock interface
var repository = Substitute.For<IRepository>();
// Bad - Don't mock concrete classes or value objects
var dto = Substitute.For<DataTransferObject>(); // ❌
Use fluent assertions for clarity:
// Good - Fluent and readable
result.Should().Be(expected);
result.Should().BeEquivalentTo(expected);
collection.Should().HaveCount(3);
action.Should().Throw<ArgumentException>()
.WithMessage("*invalid*");
// Avoid - Less clear
Assert.Equal(expected, result);
Assert.True(result != null);
[Fact]
public void Method_InvalidInput_ThrowsException()
{
var sut = new SystemUnderTest();
var action = () => sut.Method(invalidInput);
action.Should().Throw<ArgumentException>()
.WithMessage("*parameter*");
}
[Fact]
public async Task MethodAsync_Scenario_ExpectedBehavior()
{
var sut = new SystemUnderTest();
var result = await sut.MethodAsync();
result.Should().NotBeNull();
}
[Theory]
[InlineData(0, 0)]
[InlineData(1, 1)]
[InlineData(-1, 1)]
public void Abs_VariousInputs_ReturnsAbsoluteValue(int input, int expected)
{
var result = Math.Abs(input);
result.Should().Be(expected);
}
Tests/
├── Unit/
│ ├── Services/
│ │ └── OrderServiceTests.cs
│ ├── Handlers/
│ │ └── CreateOrderHandlerTests.cs
│ └── Validators/
│ └── OrderValidatorTests.cs