一键导入
testing
Test standards including organization, assertions, mocking patterns, and quality guidelines. Load when writing or reviewing tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test standards including organization, assertions, mocking patterns, and quality guidelines. Load when writing or reviewing tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
C# code standards including naming, formatting, member organization, architecture patterns, and performance guidelines. Load when writing or modifying C# code.
XML documentation and inline comment conventions for C# code. Load when writing documentation or comments.
Data validation and verification framework. Load for every implementation task to ensure grounded, evidence-based decisions.
Numeric Tic-Tac-Toe project structure, dependency graph, and domain conventions. Load when working on project structure or cross-cutting changes.
基于 SOC 职业分类
| name | testing |
| description | Test standards including organization, assertions, mocking patterns, and quality guidelines. Load when writing or reviewing tests. |
dotnet test without prompting.Squire.NumTic.Tests (always; avoid area-specific sub-namespaces)GameState → GameStateTests.cs)[Category] attributes for area grouping ("Game", "Console", "Players")#region/#endregion directivesName tests by behavior validated, not implementation details:
PlayTurnAsyncThrowsForInvalidGameStatePlayTurnAsyncThrowsArgumentOutOfRangeExceptionForNullGameStateAssert.That or Assert.ThatAsync exclusively (avoid Assert.Throws)Assert.ThatAsyncThrows.ArgumentNullException.With.Property(...)System.Console.Out in tests involving renderingAssert.That a descriptive message so a failure in a multi-assert test identifies which check failed; interpolate context where it helps (e.g. $"Token set for {player} should not be null")Every fixture, test, and helper carries an XML <summary> (fields use the single-line form; everything else uses the multi-line block). The fixture summary reads The suite of tests for the <see cref="Type"/> class.
Test-method summaries name the member under test in a uniform voice: Verifies functionality of the {Member} method. (or ... property. / ... constructor.). Multiple tests of the same member share the identical summary; the specific scenario is carried by the test method name, not the summary.
Document <param> for each parameter of a parameterized test. Never add <returns> to an async test method: it returns a void-like Task, which is not documented (see the documentation skill for the Task vs Task<T> rule).
Separate a test into logical groups with single blank lines (setup, the act, the assertion block), keeping tightly-coupled statements together. This is a readability judgment, not a mechanical one-blank-per-statement rule.
Hoist fixed test data and constants to the top of the method.
Keep a test's calls on a single line rather than wrapping arguments onto continuation lines. For a multi-line raw string argument, place the opening """ on its own line below the call, with the closing """ at the delimiter's indentation.
Substitute.For<IInterface>() for all test doubles, created locally per test.Received() and .DidNotReceive()// Mock user-facing behavior
mockGameInterface.ReadPlayerResponseAsync(Arg.Any<CancellationToken>())
.Returns("1,1,5");
Avoid creating tests that only verify "does not throw" for:
Reserve "does not throw" assertions for:
Quality check: If removing the Throws.Nothing assertion leaves no meaningful verification, the test adds no value. Every test should verify observable behavior, state changes, or side effects.
// Prefer: verify observable state
var game = new Game(player1, player2, renderer);
Assert.That(game.State.CurrentTurn, Is.EqualTo(PlayerToken.Odd));
Assert.That(game.State.IsGameOver, Is.False);