#nullable enable using System.Collections; using System.Linq; using NUnit.Framework; using ReplacedPerson.Runtime; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.TestTools; using UnityEngine.UI; namespace ReplacedPerson.Tests { public sealed class ReplacedPersonSceneTests { [UnityTest] public IEnumerator EntryScene_HasResponsiveCanvasAndAllScreens() { SceneManager.LoadScene("ReplacedPerson"); yield return null; var root = GameObject.Find("ReplacedPersonDemo"); Assert.That(root, Is.Not.Null); var camera = Camera.main; Assert.That(camera, Is.Not.Null); Assert.That(camera!.enabled, Is.True); Assert.That(camera.cullingMask, Is.Zero); var canvas = root.transform.Find("Canvas")!.GetComponent(); var scaler = canvas.GetComponent(); Assert.That(canvas.renderMode, Is.EqualTo(RenderMode.ScreenSpaceOverlay)); Assert.That(scaler.referenceResolution, Is.EqualTo(new Vector2(1920, 1080))); Assert.That(root.transform.Find("Canvas/SafeAreaRoot")!.GetComponent(), Is.Not.Null); Assert.That(root.GetComponentsInChildren(true), Has.Length.GreaterThan(20)); Assert.That(root.GetComponentsInChildren