A C#-based unit testing framework that works in Unity3D
C# Shell
Pull request Compare This branch is 10 commits behind tenpn:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


##UnTest Unity3D Testing Framework v0.4.0

Because there is always one less unit-testing framework than there needs to be.


Download the latest release from here:


...And extract into your project.


A test suite looks like this:

using UnTest;
// all classes marked with TestSuite get tested 
class MyTestSuite {

    private MockFoo m_instance;

    // called before every test        
    void DoSetup() {
        m_instance = new MockFoo();

    // any exception is a test failure
    void GetResult_WithValidResult_GivesResult() {
        Assert.IsTrue(m_instance.Result == 3); 


You should put them below an editor folder of your project so they're not shipped in builds.

####To Run

From the command line:

You have two options on the command line. The Unity3D application can deal with added/removed files, but is quite slow, the output is quite verbose and it won't work if the Unity3D editor is currently open. This is the syntax:

/path/to/unity -projectPath "path/to/project" 
    -batchmode -logFile 
    -executeMethod UnTest.UnityTestRunner.RunTestsFromConsole 

Alternatively you can use the .Net UnTest-Console tool to find and execute tests in your built Unity3D DLLs. This is the command:

mono --debug /path/to/project/Assets/UnTest/Editor/UnTest-Console/bin/Release/UnTest-Console.exe path/to/DLL/folder

The --debug flag allows the tool to report on line numbers. Your DLL folder is in path/to/project/Libary/ScriptAssemblies if built with the editor, or path/to/project/Temp/bin/debug if built with monodevelop/mdtool.

As a convenience, Untest/Editor/RunTests.sh will, when given the path to your project SLN, build the assemblies using mdtool then run the tests with UnTest-Console.

The tests can also be run from the editor. To do this, select Run from the Assets->Tests menu.

Copyright(c) 2013 Andrew Fray Licensed under the MIT license. See the license.txt file for full details.