スキル一覧に戻る
dmytroett

snapshot-unit-testing

by dmytroett

Register your services in IoC container in AOP style.

1🍴 1📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: snapshot-unit-testing description: Write or update unit (not integration) tests in this repo, use Verify snapshot testing for source generator output, and run/accept snapshots via the provided scripts.

Scope

Locate unit tests under test/*UnitTests. Use Verify snapshots when validating generated output; prefer normal assertions for non-generator logic.

Principles

Favor a small number of representative scenarios; combine related assertions to minimize snapshot files even if individual tests are larger.

Avoid opening or reading .received/.verified files; rely on dotnet test output and VerifyException details only.

Treat .codex/skills/snapshot-unit-testing/scripts/accept-snapshot and .codex/skills/snapshot-unit-testing/scripts/accept-all-snapshots as black boxes; do not open or inspect them.

Workflow

Write or update the test based on a concrete scenario.

Run targeted tests with dotnet test --filter and add --no-build/--no-restore when appropriate.

Inspect dotnet test output to decide whether the test logic is wrong or snapshots need updating; do not open raw snapshot files.

Accept snapshots only when the behavior change is intended and clearly understood:

  • Use .codex/skills/snapshot-unit-testing/scripts/accept-snapshot <TestClassName> <TestMethodName> for a single test.
  • Use .codex/skills/snapshot-unit-testing/scripts/accept-all-snapshots for bulk updates.
  • Skip these scripts for non-snapshot tests.

Re-run tests and iterate until they pass.

Commands

  • Run a single test:
    • dotnet test --filter "FullyQualifiedName~<TestClass>.<TestMethod>"
  • Accept one snapshot:
    • .codex/skills/snapshot-unit-testing/scripts/accept-snapshot.ps1 <TestClassName> <TestMethodName>
  • Accept all snapshots:
    • .codex/skills/snapshot-unit-testing/scripts/accept-all-snapshots.ps1

Verify failure pattern

Use the failure output only; do not open the files listed.

VerifyException : Directory: /home/me/projects/AttributedDI/test/AttributedDI.SourceGenerator.UnitTests/Snapshots
  NotEqual:
    - Received: AddAttributedDiTests.GeneratesAddAttributedDiForEntryPoint.DotNet9_0.received.txt
      Verified: AddAttributedDiTests.GeneratesAddAttributedDiForEntryPoint.verified.txt

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です