Unity Test Tools

Requires Unity 4.0.0 or higher.
Unity Test Tools allows you to test Unity content.

Features:
- Unit Test Framework
- Integration Test Framework
- Assertion Component
- Integrated IDE, batch mode runners and integration tests player runner

Source code is now hosted on Bitbucket.

Documentation (English and Japanese)

Examples are included in the package.

For feedback and question please use Unity Forums or Bitbucket's Issue Tracker.
 
Originally released: 18 December 2013
Package has been submitted using Unity 4.0.0, 4.2.2, 5.0.0, 5.1.0, 5.3.0, 5.4.0, and 5.5.0 to improve compatibility within the range of these versions of Unity.

Package Contents

UnityTestTools
Assertions
AssertionComponent.cs
AssertionException.cs
Assertions.cs
CheckMethod.cs
Comparers
ActionBase.cs
BoolComparer.cs
ColliderComparer.cs
ComparerBase.cs
FloatComparer.cs
GeneralComparer.cs
IntComparer.cs
IsRenderedByCamera.cs
StringComparer.cs
TransformComparer.cs
ValueDoesNotChange.cs
Vector2Comparer.cs
Vector3Comparer.cs
Vector4Comparer.cs
VectorComparerBase.cs
Editor
AssertionComponentEditor.cs
AssertionExplorerWindow.cs
AssertionListRenderer.cs
AssertionStripper.cs
DropDownControl.cs
GroupByComparerRenderer.cs
GroupByExecutionMethodRenderer.cs
GroupByGORenderer.cs
GroupByNothingRenderer.cs
GroupByTestsRenderer.cs
PropertyPathSelector.cs
PropertyResolver.cs
InvalidPathException.cs
MemberResolver.cs
changelog.txt
Common
Editor
Icons.cs

Recommendations

1-3 of 30

Customers also purchased

1-3 of 30

User Reviews

4 years ago

This review was submitted for a previous version of the package. Version: 1.0


Wow

(26 of 26 found this review helpful)

Ok, this plugin made me very happy.

Answering the guy above, how I use the mocks here (with NSubstitute)

Suppose the MonoBehaviour class name is Player:

1. Create a IPlayer interface.
2. Make the Player implements it.
3. In the test, write IPlayer p = Substitute.For<IPlayer>()
4. Use the 'p' mock object to make the operations.
5. These operations you can check at http://nsubstitute.github.io/


I've found a (possible) bug though. When I make a TestFixture class extends another TestFixture class, the Test Runner window goes buggy, showing the same test more than once.

Reply from publisher

4 years ago

Hi Ramon,
Nice spot! We'll give it a look before next release.
Tomek

4 months ago

Warning

(23 of 24 found this review helpful)

"Assets/UnityTestTools/Examples/UnitTestExamples/Editor/SampleTests.cs(74,10): error CS0246: The type or namespace name `ExpectedException' could not be found. Are you missing an assembly reference?"

This one appeared in the with the NUnit 3 (Unity 5.6) update . Please, fix it.

4 years ago

This review was submitted for a previous version of the package. Version: 1.0


Good job

(19 of 21 found this review helpful)

Most awaited feature from developers! But what about Mocks? How to mock existing MonoBehavior in unit test?

Reply from publisher

3 years ago

Maybe you will find this helpful //blogs.unity3d.com/2014/06/03/unit-testing-part-2-unit-testing-monobehaviours/

All prices are exclusive of VAT