UnityGame/Library/PackageCache/com.unity.test-framework/Documentation~/index.md
2024-10-27 10:53:47 +03:00

2.4 KiB

About Unity Test Framework

The Unity Test Framework (UTF) enables Unity users to test their code in both Edit Mode and Play Mode, and also on target platforms such as Standalone, Android, iOS, etc.

This package provides a standard test framework for users of Unity and developers at Unity so that both benefit from the same features and can write tests the same way.

UTF uses a Unity integration of NUnit library, which is an open-source unit testing library for .Net languages. UTF currently uses NUnit version 3.5. For more information about NUnit, see the official NUnit website and the NUnit documentation.

Note

: UTF is not a new concept or toolset; it is an adjusted and more descriptive naming for the toolset otherwise known as Unity Test Runner, which is now available as this package.

Installing Unity Test Framework

The Test Framework package is shipped with the Unity Editor and should be automatically included in any project created with Unity 2019.2 or later. If you need to install the package manually, you can do so in any of the standard ways documented in the Package Manager documentation.

Note

: If you're adding the package by name, the canonical name to use is com.unity.test-framework. If you're adding it from the registry, the package is listed under the display name Test Framework.

Using Unity Test Framework

To learn how to use the Unity Test Framework package in your project, read the manual.

Technical details

Requirements

This version of the Unity Test Framework is compatible with the following versions of the Unity Editor:

  • 2019.2 and later.

Known limitations

Unity Test Framework version 1.3.x includes the following known limitations:

  • The UnityTest attribute does not support WSA platform.
  • The UnityTest attribute does not support Parameterized tests (except for ValueSource).
  • The UnityTest attribute does not support the NUnit Repeat attribute.
  • Nested test fixture cannot run from the Editor UI.
  • When using the NUnit Retry attribute in PlayMode tests, it throws InvalidCastException.