Unity 5.6 Unit Testing

I noticed that there have been some changes in the Unit Testing framework inside Unity. The only change that I saw documented (even though it was difficult to find) was that NUnit was updated to version 3.6. I updated and some of our Unit/Integration tests are now failing. We have some failing because calls are being made not on the main thread, and I’ve also noticed the new “PlayMode” in the test runner which I can find 0 information on it seems.

Can someone please either point me in a direction to see the update changes or explain what the PlayMode is and perhaps what core changes beyond the NUnit update have been made? I would greatly appreciate this, thank you.


The docs are taking a little linger to update then expected. Sorry about that. In the meantime here are the draft docs for the new test runner: [5.6 DRAFT] Unity Test Runner docs - Google Docs

Hi, regarding the “Example in Edit mode”: What should RunEditorUtilityInTheBackgroud look like?
Is it possible to instantiate a Class extending MonoBehaviour inside a test in EditMode? Will Awake() be called during the test?

I tried the following, where LateUpdate is called, Awake isn’t:

GameObject gameObject = new GameObject();
MyObject = gameObject.AddComponent (typeof(MyObject)) as MyObject;

EditorApplication.update += Update;
// yield to skip a frame
yield return null;

Thanks in advance.

Hi Tomek, please is there a way to visualise a gameobejct AFTER a test has been ran, I notice everything is deleted after running the tests, I would like to see a gameobject and its properties after a unittest, for debugging purposes, thanks.