From f13103a9e5e9159cd621b45f667916bb6948031b Mon Sep 17 00:00:00 2001 From: Daniel Lovell Date: Wed, 2 Oct 2024 02:23:30 -0700 Subject: [PATCH] Add SanityTest to bamlab.test.playmode --- Assets/Tests/PlayMode/SanityTest.cs | 25 ++++++++++++++++++++++++ Assets/Tests/PlayMode/SanityTest.cs.meta | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 Assets/Tests/PlayMode/SanityTest.cs create mode 100644 Assets/Tests/PlayMode/SanityTest.cs.meta diff --git a/Assets/Tests/PlayMode/SanityTest.cs b/Assets/Tests/PlayMode/SanityTest.cs new file mode 100644 index 0000000..cbfdd93 --- /dev/null +++ b/Assets/Tests/PlayMode/SanityTest.cs @@ -0,0 +1,25 @@ +using System.Collections; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.TestTools; + +public class SanityTest +{ + [UnityTest] + public IEnumerator SanityCheck() + { + // Arrange + GameObject testObject = new GameObject("TestObject"); + + // Act + testObject.AddComponent(); + + // Assert + Assert.IsTrue(testObject.GetComponent() != null, "BoxCollider should be added to the test object"); + + // Clean up + Object.Destroy(testObject); + + yield return null; + } +} \ No newline at end of file diff --git a/Assets/Tests/PlayMode/SanityTest.cs.meta b/Assets/Tests/PlayMode/SanityTest.cs.meta new file mode 100644 index 0000000..e627807 --- /dev/null +++ b/Assets/Tests/PlayMode/SanityTest.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2e04183212e40bf43a2625427494a839 \ No newline at end of file