| | | 1 | | using System.Collections; |
| | | 2 | | using NUnit.Framework; |
| | | 3 | | using UnityEngine; |
| | | 4 | | using UnityEngine.TestTools; |
| | | 5 | | |
| | | 6 | | public class SanityTests { |
| | | 7 | | [UnityTest] |
| | 0 | 8 | | public IEnumerator SanityCheck() { |
| | | 9 | | // Arrange |
| | 0 | 10 | | GameObject testObject = new GameObject("TestObject"); |
| | | 11 | | |
| | | 12 | | // Act |
| | 0 | 13 | | testObject.AddComponent<BoxCollider>(); |
| | | 14 | | |
| | | 15 | | // Assert |
| | 0 | 16 | | Assert.IsTrue(testObject.GetComponent<BoxCollider>() != null, |
| | | 17 | | "BoxCollider should be added to the test object"); |
| | | 18 | | |
| | | 19 | | // Clean up |
| | 0 | 20 | | Object.Destroy(testObject); |
| | | 21 | | |
| | 0 | 22 | | yield return null; |
| | 0 | 23 | | } |
| | | 24 | | } |