Add SanityTest to bamlab.test.playmode
This commit is contained in:
25
Assets/Tests/PlayMode/SanityTest.cs
Normal file
25
Assets/Tests/PlayMode/SanityTest.cs
Normal file
@@ -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<BoxCollider>();
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(testObject.GetComponent<BoxCollider>() != null, "BoxCollider should be added to the test object");
|
||||
|
||||
// Clean up
|
||||
Object.Destroy(testObject);
|
||||
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
2
Assets/Tests/PlayMode/SanityTest.cs.meta
Normal file
2
Assets/Tests/PlayMode/SanityTest.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e04183212e40bf43a2625427494a839
|
||||
Reference in New Issue
Block a user