unity-testing
Skill1 starsChanged 5 months agoMITView on GitHub
Guide for testing Unity applications. Covers Unity Test Framework, what's testable vs requires human validation, and Zenject testing patterns.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- TheArcForge/hades-plugintheir own version, first seen Nov 16, 2026
- MRCalderon3D/everything-game-dev-codetheir own version, first seen Oct 13, 2026
- Nice-Wolf-Studio/unity-claude-skillstheir own version, first seen Sep 14, 2026
- IceMasterT/Unity-6.3_SKILLStheir own version, first seen Aug 19, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- MRCalderon3D/everything-game-dev-code★ 105same name
- Nice-Wolf-Studio/unity-claude-skills★ 32same name
- TheArcForge/hades-plugin★ 3same name
- IceMasterT/Unity-6.3_SKILLS★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- unity-architecture-conventionsSkill
- unity-coding-conventionsSkill
- unity-folder-conventionsSkill
- unity-mcp-toolsSkill
- unity-performanceSkill
- unity-ugui-developmentSkill
- unity-ugui-listSkill
- writing-testsSkill
- zenject-conventionsSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Rule of thumb: No MonoBehaviour lifecycle needed and no timing → Edit Mode.
- Distinctive: line 117
Use MCP tools to run tests and read failure details — not the Unity Editor test runner UI.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity Testing Guide
Testing reference for Unity projects using Zenject.
Edit Mode vs Play Mode
| Use Edit Mode when... | Use Play Mode when... |
| Pure logic, calculations, data transforms | Needs Start(), Update(), or other lifecycle |
| State machines, service logic | Coroutines or async operations |
| Event wiring (subscribe/fire/assert) | Physics, scene loading |
| Anything without MonoBehaviour dependency | Time-based behavior (timers, cooldowns) |
| Multi-system integration through full container |
Rule of thumb: No MonoBehaviour lifecycle needed and no timing → Edit Mode. Otherwise → Play Mode.
Testable vs Human Validation
| Testable (automated) | Human validation (manual) |
| Logic and calculations | Visual appearance |
| State transitions | Animation feel |
| Event wiring and callbacks | Game feel / fun |
| Data transformations | Audio quality |
| Service interactions | Input responsiveness on device |
| Boundary conditions (min/max/zero) | Performance / frame rate |
Design principle: Keep logic separate from visuals. A service that computes results is trivially testable. A MonoBehaviour that displays those results requires manual validation. The more logic lives in injectable services, the more you can test automatically. Test the public interface — how the class will actually be used — not its internals.
Zenject Test Fixtures
ZenjectUnitTestFixture (Edit Mode)
Isolated DI container per test. Bind only what you need.
using NUnit.Framework;
using Zenject;
public class ScoreServiceTests : ZenjectUnitTestFixture
{
[Inject] private ScoreService _scoreService;
[SetUp]
public void Setup()
{
Container.Bind<ScoreService>().AsSingle();
Container.Inject(this);
}
[Test]
public void AddScore_IncreasesTotal()
{
_scoreService.Add(100);
Assert.AreEqual(100, _scoreService.Total);
}
}ZenjectIntegrationTestFixture (Play Mode)
Full container with MonoBehaviour lifecycle. Use when testing systems that depend on Start().
using System.Collections;
using NUnit.Framework;
using UnityEngine.TestTools;
using Zenject;
public class GameFlowTests : ZenjectIntegrationTestFixture
{
[UnityTest]
public IEnumerator GameOver_WhenHPReachesZero()
{
PreInstall();
Container.Bind<HPService>().AsSingle();
Container.Bind<GameStateService>().AsSingle();
PostInstall();
yield return null; // Let Start() execute
var hp = Container.Resolve<HPService>();
var state = Container.Resolve<GameStateService>();
hp.TakeDamage(hp.MaxHP);
Assert.AreEqual(GameState.Over, state.Current);
}
}Pitfalls
- Injection timing: Dependencies are available in
Start(), notAwake(). Tests that create MonoBehaviours mustyield return nullafter setup to letStart()run before asserting. - Edit Mode cannot yield: No
WaitForSeconds, no coroutines, no frame advancement. If your test needs any of these → Play Mode. Time.deltaTimeis zero in Edit Mode: Time-dependent logic must be tested in Play Mode, or accept a time parameter for testability.- Project convention — no IInitializable/ITickable/IDisposable: Use MonoBehaviour lifecycle instead. This means integration tests often need Play Mode +
yield return nullforStart()to fire. - PostInstall before resolving: In
ZenjectIntegrationTestFixture, always callPostInstall()before resolving or injecting.yield return nullafter PostInstall forStart().
Running Tests
Use MCP tools to run tests and read failure details — not the Unity Editor test runner UI.
References (don't duplicate — look here instead)
- Test file locations and path mirroring →
unity-folder-conventionsskill - Naming conventions →
unity-coding-conventionsskill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

