Ejemplo n.º 1
0
        public void ShowHistoryButtonChangesStateToHistoryState_Test()
        {
            StateFlowTests.InMainMenu(_context); // Start from main menu

            _buttons.ShowHistoryButton();
            Assert.AreEqual(typeof(HistoryState), _context.CurrentState.GetType());
        }
Ejemplo n.º 2
0
        public IEnumerator ShowHistoryButtonExistsOnMainMenu_Test()
        {
            // use coroutine test because it needs to wait a few frames for scene to load
            StateFlowTests.InMainMenu(_context);
            var cameraButton = GameObject.FindGameObjectWithTag("ToHistory");

            Assert.NotNull(cameraButton);
            yield return(null);
        }
Ejemplo n.º 3
0
        public IEnumerator ShowCameraButtonGameObjectOnMainMenuHasButtonComponent_Test()
        {
            // use coroutine test because it needs to wait a few frames for scene to load
            StateFlowTests.InMainMenu(_context);
            var cameraButton = GameObject.FindGameObjectWithTag("ToCamera");

            Assert.NotNull(cameraButton.GetComponent <Button>());
            yield return(null);
        }
Ejemplo n.º 4
0
        public IEnumerator OnlySingleShowCameraButtonExistsOnMainMenu_Test()
        {
            // use coroutine test because it needs to wait a few frames for scene to load
            StateFlowTests.InMainMenu(_context);
            var cameraButton = GameObject.FindGameObjectsWithTag("ToCamera");

            Assert.AreEqual(1, cameraButton.Length);
            yield return(null);
        }
Ejemplo n.º 5
0
        public IEnumerator ShowCameraButtonOnMainMenuHasRegisteredEventListeners_Test()
        {
            // use coroutine test because it needs to wait a few frames for scene to load
            StateFlowTests.InMainMenu(_context);
            var cameraButton  = GameObject.FindGameObjectWithTag("ToCamera");
            var listenerCount = cameraButton.GetComponent <Button>().onClick.GetPersistentEventCount();

            Assert.IsTrue(listenerCount > 0);
            yield return(null);
        }