test-writing-guide
Installation
SKILL.md
Guide for writing test code for Unity projects.
Rules
- Before modifying any test file, check if the editor is in Play Mode. If it is, stop it using the
unity_play_controltool first. - Never create
.metafiles. Unity editor creates them automatically.
Integration Tests
When implementing a test classified as an integration test, add [Category("Integration")] to the test method.
UI Tests
Use GameObjectFinder instead of GameObject.Find
When finding a GameObject that the user interacts with, always use GameObjectFinder instead of UnityEngine.GameObject.Find or Object.FindFirstObjectByType.
Reasons: