Skip to content

Instantly share code, notes, and snippets.

@wiverson
Created August 7, 2018 17:58
Show Gist options
  • Save wiverson/adc63de6ff70ab4f8cf6c2ca92f2849e to your computer and use it in GitHub Desktop.
Save wiverson/adc63de6ff70ab4f8cf6c2ca92f2849e to your computer and use it in GitHub Desktop.
Example of Unity3D test and the command line to run it
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
/**
/Applications/Unity/Hub/Editor/2018.1.7f1/Unity.app/Contents/MacOS/Unity
-batchmode -nographics -runEditorTests -projectPath /Users/wiverson/Desktop/test-test/TestTest
*/
public class TestTest {
[Test]
public void someRandomTest () {
Assert.AreEqual ("First", "First");
//Expect a regular log message
LogAssert.Expect (LogType.Log, "Tests Running!");
//A log message is expected so without the following line
//the test would fail
Debug.Log ("Tests Running!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment