| 123456789101112131415161718192021222324252627 |
- using System.Collections;
- using System.Linq;
- using NUnit.Framework;
- using UnityEngine;
- using UnityEngine.TestTools;
- using UnityEngine.UI;
- namespace HexaCrazy.Tests
- {
- public class StartupFlowTests
- {
- HexGameApp app;
- [UnityTearDown] public IEnumerator Cleanup()
- { if (app != null) Object.Destroy(app.gameObject); yield return null; }
- [UnityTest] public IEnumerator GameStartsWithoutRuntimeSdkAndIgnoresDuplicateClick()
- {
- app = new GameObject("StartupTest").AddComponent<HexGameApp>();
- yield return null;
- Assert.AreEqual("Start", app.ScreenName);
- var button = app.Root.GetComponentsInChildren<Button>().Single(b => b.name == "GameStart");
- Assert.IsTrue(button.interactable);
- Assert.IsFalse(app.GetComponent<HexAudio>().Music);
- button.onClick.Invoke(); button.onClick.Invoke();
- Assert.AreEqual("Lobby", app.ScreenName);
- Assert.IsFalse(typeof(HexGameApp).Assembly.GetReferencedAssemblies().Any(a => a.Name == "AppRuntimes"));
- }
- }
- }
|