Get started with Unity Test Framework
Testing your codeWrite tests for your Edit mode or Play mode code and run them through the Unity Editorâs Test RunnerThe Test Framework package (formerly called the Test Runner) is a Unity tool that tests your code in both Edit mode and Play mode, and also on target platforms such as Standalone, Android, or iOS. More info
See in Glossary window, from the command line, or from code. Unity Test Framework integrates a custom version of NUnit, the open-source unit testing library for .NET languages and extends it with Unity-specific capabilities.
As an alternative to NUnit tests, Unity Test Framework provides Unity tests, which can interact with Unity-specific concepts such as frames, the application loop, and domain reload. A Unity test runs as a coroutine in Play mode and in the EditorApplication.update
callback loop in Edit mode.
Unity tests can yield instructions for the Unity Editor. Once the instruction is complete, the test run continues. You can also yield return null
in a Unity test to skip a frame and defer an operation until the next iteration of either the EditorApplication.update
or the per-frame game update loop.
This documentation assumes youâre familiar with NUnit and with fundamental principles of unit testing in C#. If youâre not, refer to Unit testing C# with NUnit and .NET Core and Unit testing best practices in the Microsoft documentation.
Note: Unity Test Framework is a core Unity package and is distributed as part of a Unity Editor installation. Unity Test Framework currently uses a custom version of NUnit based on version 3.5.
Additional resourcesGet started with Unity Test Framework
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4