Skip to content

Instantly share code, notes, and snippets.

@rygo6
Last active March 28, 2017 08:16
Show Gist options
  • Save rygo6/45768c4c8a8292a8af1e6192e578ae1f to your computer and use it in GitHub Desktop.
Save rygo6/45768c4c8a8292a8af1e6192e578ae1f to your computer and use it in GitHub Desktop.
Default unit test script for Unity.
using UnityEngine;
using UnityEditor;
using NUnit.Framework;
public class NewEditorTest {
[Test]
public void EditorTest()
{
//Arrange
var gameObject = new GameObject();
//Act
//Try to rename the GameObject
var newGameObjectName = "My game object";
gameObject.name = newGameObjectName;
//Assert
//The object has a new name
Assert.AreEqual(newGameObjectName, gameObject.name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment