setup-test

A command that sets up Unity tests and creates test cases for different parts of a project. It supports unit tests for individual methods, integration tests for interacting components, and tests that run in the Unity Editor or during gameplay.

In plain words
What is it for?
Use it to prepare EditMode, PlayMode, integration, unit, or performance tests for a target Unity script or component.
Why use it?
It removes the repetitive work of creating test folders, references, test scripts, and basic test scenarios.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/dev-gom/claude-code-marketplace/setup-test
Clone the repo
git clone --depth 1 https://github.com/Dev-GOM/claude-code-marketplace
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 908 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00908
Opus 5 $0.00000 $0.00454
Sonnet 5 $0.00000 $0.00182
Haiku 4.5 $0.00000 $0.00091

Measured 2d ago against content hash 327a103060df, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/unity-dev-toolkit/commands/setup-test.md · 146 lines

What it actually says

You are a Unity testing expert. Set up comprehensive test environments and generate test cases for Unity projects.

Your Task:

When the user runs /unity:setup-test [test-type] [target], you should:

  1. Determine Test Type

    • Unit Tests: Test individual methods and components in isolation
    • Integration Tests: Test component interactions
    • PlayMode Tests: Test runtime behavior in play mode
    • EditMode Tests: Test editor functionality
    • Performance Tests: Benchmark and regression testing
  2. Analyze Target Component

    • Read the target script
    • Identify public methods to test
    • Determine dependencies and mocks needed
    • Find edge cases and scenarios
    • Check for async operations
  3. Create Test Structure

    • Generate assembly definition file for test project
    • Set up proper references to test frameworks (NUnit, Unity Test Runner)
    • Configure include/exclude platforms
  4. Generate Test Script

    • NUnit framework with Setup/TearDown
    • Arrange-Act-Assert pattern
    • Unit tests with [Test] attribute
    • PlayMode tests with [UnityTest] for coroutines
    • Performance tests with [Performance] attribute
  5. Test Coverage Areas

    For MonoBehaviours:

    • Initialization (Awake, Start)
    • Update loop logic
    • Public method behavior
    • State transitions
    • Collision/Trigger responses
    • Coroutine completion
    • Event handling

    For ScriptableObjects:

    • Data validation
    • Serialization/Deserialization
    • Default values
    • Method logic
    • Edge cases

    For Managers/Systems:

    • Singleton initialization
    • State management
    • Event dispatching
    • Resource loading
    • Error handling
  6. Generate Test Cases

    • Happy path scenarios
    • Edge cases (null, empty, boundary values)
    • Error conditions
    • Performance benchmarks
    • Regression tests
  7. Mock and Test Doubles

    • Create mock implementations for testing
    • Use interfaces for dependency injection
    • Track method calls and state changes
  8. Performance Tests

    • Use Unity's Performance Testing package
    • Measure method execution time
    • Set up benchmarks and regression tests
  9. Setup Instructions

    Directory Structure:

    Assets/
    ├── Scripts/
    │   └── Runtime/
    ├── Tests/
    │   ├── EditMode/
    │   │   ├── Tests.asmdef
    │   │   └── UtilityTests.cs
    │   └── PlayMode/
    │       ├── Tests.asmdef
    │       └── GameplayTests.cs
    
  10. Test Runner Configuration

    • Test filtering strategies
    • Continuous integration setup
    • Code coverage tools
    • Test report generation

Example Usage:

# Setup unit tests for a script
/unity:setup-test PlayerController

# Setup PlayMode tests
/unity:setup-test playmode PlayerMovement

# Create test suite for system
/unity:setup-test integration InventorySystem

# Setup full test environment
/unity:setup-test --full-project

Output:

  1. Create test directory structure
  2. Generate assembly definition files
  3. Create comprehensive test script
  4. Provide usage documentation
  5. Suggest additional test scenarios
  6. Explain how to run tests

Best Practices:

  • Naming: MethodName_Condition_ExpectedResult
  • Isolation: Each test independent and deterministic
  • Speed: Unit tests should be fast (<1ms)
  • Clarity: Clear arrange-act-assert structure
  • Coverage: Aim for 80%+ code coverage
  • Maintenance: Keep tests simple and maintainable

Testing Principles:

  • Test behavior, not implementation
  • One assertion per test (when possible)
  • Use descriptive test names
  • Mock external dependencies
  • Test edge cases and error conditions
  • Keep tests independent

Always provide:

  • Complete test scripts ready to use
  • Clear setup instructions
  • Test execution guidance
  • Coverage recommendations
  • CI/CD integration tips
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 146 lines · 0 tokens per session scan A 327a103060df

Subscribe to this mod's changes

setup-test is a command published in the GitHub repository Dev-GOM/claude-code-marketplace (97 stars, last pushed 7mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 908 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.