This commit is contained in:
2026-08-28 15:56:12 +01:00
commit 4d5f73e29c
7349 changed files with 664196 additions and 0 deletions
@@ -0,0 +1,6 @@
{
"name": "PlayModeTests_12",
"optionalUnityReferences": [
"TestAssemblies"
]
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 712147f25a259f640adb238565c2b431
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,42 @@
using System.Collections;
using System.IO;
using System.Linq;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
namespace PlayModeTests_12
{
public class SceneTests
{
private string originalScene;
private const string k_SceneName = "Assets/MyGameScene.unity";
[UnitySetUp]
public IEnumerator SetupBeforeTest()
{
originalScene = SceneManager.GetActiveScene().path;
if (!File.Exists(k_SceneName))
{
Assert.Inconclusive("The path to the Scene is not correct. Set the correct path for the k_SceneName variable.");
}
SceneManager.LoadScene(k_SceneName);
yield return null; // Skip a frame, allowing the scene to load.
}
[Test]
public void VerifyScene()
{
var gameObject = GameObject.Find("GameObjectToTestFor");
Assert.That(gameObject, Is.Not.Null, $"GameObjectToTestFor not found in {SceneManager.GetActiveScene().path}.");
}
[TearDown]
public void TeardownAfterTest()
{
SceneManager.LoadScene(originalScene);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b3ee2a6b718e39e40a4a428c049069f1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: