unity-testability

Advise on isolating Unity logic from APIs for EditMode and PlayMode testing.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/jinluli/EnglishLearnTool --skill unity-testability-jinluli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-testability
Source: https://github.com/jinluli/EnglishLearnTool/tree/main/Packages/SkillsForUnity/unity-skills~/skills/testability
Command: npx skills add https://github.com/jinluli/EnglishLearnTool --skill unity-testability-jinluli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps improve Unity testability by isolating logic from Unity APIs, deciding what belongs in EditMode or PlayMode tests, and reducing hard-to-test MonoBehaviour logic.

Core Features & Use Cases

  • Testability Advisor: Provides guidance on improving testability in Unity projects.
  • Logic Isolation: Helps decide what logic should remain in Unity-facing classes and what should move into pure C# code.
  • Use Case: For example, when developing a Unity game, this Skill can help you determine which parts of your code should be tested in EditMode and which in PlayMode, improving overall testability.

Quick Start

Use the unity-testability skill to analyze your Unity project and receive recommendations on improving testability.

Frequently Asked Questions about unity-testability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate game logic from Unity APIs for better unit testing?

To isolate game logic from Unity APIs for unit testing, you should move pure C# logic out of MonoBehaviour classes into separate assemblies. This separation allows you to test core mechanics independently of the Unity engine lifecycle.

What is the difference between EditMode and PlayMode tests in Unity?

EditMode tests run outside the Unity runtime and are used for testing pure C# logic, while PlayMode tests run inside the Unity engine and are used for testing MonoBehaviour behavior and Unity API integrations.

How do I decide what logic should move out of MonoBehaviour classes?

You should move logic that does not directly require Unity API calls out of MonoBehaviour classes. Isolating state calculations and data processing into pure C# scripts allows them to be tested in EditMode without engine dependencies.

Can I test hard-to-test MonoBehaviour logic without running the full Unity game?

You can test hard-to-test MonoBehaviour logic by extracting the internal algorithms into pure C# classes. This allows you to verify the behavior in EditMode tests without the overhead of running the full Unity game runtime.

What are the limitations of isolating Unity logic for testability?

A limitation of isolating Unity logic is that code heavily reliant on the Unity API lifecycle, such as physics or coroutines, cannot be fully isolated. You must determine which parts require PlayMode tests and which can move to pure C#.