Skip to content
Development
Command

/test-dotnet

Run C# tests: Unity Test Framework in batchmode, or dotnet test

From plugin
ai-kit
11154 skills15 agents54 commands4 MCP
> /plugin marketplace add solanabr/ai-kit
> /plugin install solana-ai-kit@stbr

Command definition

test-dotnet.md
description: "Run C# tests: Unity Test Framework in batchmode, or dotnet test"

Run the C# test suites and summarize failures. `$ARGUMENTS` can name a platform (`editmode`, `playmode`) and a filter (class, method, or category).

Unity test structure, naming, test doubles and async patterns: [solana-game testing.md](../skills/ext/solana-game/skill/testing.md) (install first: `bash .claude/bin/skills.sh add solana-game`).

Unity

Run tests through the editor. The `.csproj` and `.sln` files Unity generates are for IDEs; `dotnet test` cannot build them.

`<unity> -batchmode -nographics -projectPath . -runTests -testPlatform EditMode -testResults TestResults/editmode.xml -logFile TestResults/editmode.log`

  • `<unity>` is the editor matching `m_EditorVersion` in `ProjectSettings/ProjectVersion.txt`: `/Applications/Unity/Hub/Editor/<version>/Unity.app/Contents/MacOS/Unity` on macOS, `C:\Program Files\Unity\Hub\Editor\<version>\Editor\Unity.exe` on Windows. GameCI images ship it as `unity-editor`.
  • Leave out `-quit`: the test runner closes the editor when the run ends, and `-quit` can end it before tests run. Close any editor that has the project open, or batchmode fails on the project lock.
  • `-testPlatform PlayMode` for PlayMode tests; drop `-nographics` if they render. Narrow with `-testFilter "Ns.Class.Method"` (semicolon list or regex), `-testCategory "Unit;!Integration"` (the `!` skips network-bound tests), or `-assemblyNames "Game.Tests"`.
  • No results XML means the run died before any test ran, usually on a compile error: search the log for `error CS`. The XML is NUnit 3: totals sit on the root `<test-run>` (`total`, `passed`, `failed`), and each failure is a `<test-case result="Failed">` with `<failure><message>` and `<stack-trace>`. Count `Inconclusive` as failed.
  • Tests not discovered: test assemblies cannot reference the default `Assembly-CSharp`, so game code needs its own `.asmdef`. The test `.asmdef` references it plus `UnityEngine.TestRunner` and `UnityEditor.TestRunner`, adds `nunit.framework.dll` through `overrideReferences`, and sets `defineConstraints: ["UNITY_INCLUDE_TESTS"]`; EditMode test assemblies also set `includePlatforms: ["Editor"]`.

.NET services

1. `dotnet restore` after a clone or any change to `.csproj`, `.sln`, `Directory.Packages.props` or `packages.config`. 2. `dotnet build --no-restore --nologo -v minimal`, then `dotnet test --no-build --nologo -v minimal`. Narrow with `--filter "FullyQualifiedName~WalletService"`, `"Category=Unit"` (NUnit; xUnit filters on trait names, MSTest on `TestCategory`), or combinations such as `"Name~Connect&Category!=Integration"`. 3. Show only failures: `dotnet test --no-build -v normal | rg -e "Failed" -e "Error Message:" -e "Stack trace:" -C 4`.

Fix loop

Fix, rebuild, retest. If the same error survives two attempts, stop and show the user the error output and the change you tried instead of guessing further.

Output

Pass, fail and skip counts per platform or project, then each failing test with its message and the first stack frame in project code.

Read more
@solanabr
Ships withai-kit

Claude Code, set up to ship on Solana. Not programs alone — the whole lifecycle: validating the idea, building the program and the app around it, shipping it, and the launch and growth work that follows.

1113 skills15 agents4 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
111
Star history of solanabr/solana-ai-kit on GitHub, a chart by star-history.com

Other commands on ai-kit.

add-skill

add-skill

Command

Install a pinned skill extension on demand (/add-skill <id>), or list core packs and extensions

@solanabr@solanabrInstall Command
adv

adv

Command

Short for /adversarial: run every task through proposer and adversary pairs, no triage

@solanabr@solanabrInstall Command
adversarial

adversarial

Command

Put a task's load-bearing claims and key decisions through a proposer and an adversary, with proof

@solanabr@solanabrInstall Command
audit-solana

audit-solana

Command

Audit Solana program code for exploitable bugs and write a findings report

@solanabr@solanabrInstall Command
benchmark

benchmark

Command

Compare per-instruction CU with the stored baseline to catch regressions

@solanabr@solanabrInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command