Beispiel #1
0
        public void ShowMainMenuButtonChangesStateToMainMenuState_Test()
        {
            StateFlowTests.NavigateToCameraViewFromMainMenu(_context); // Have to move out of main menu to move back

            _buttons.ShowMainMenuButton();
            Assert.AreEqual(typeof(MainMenuState), _context.CurrentState.GetType());
        }
Beispiel #2
0
        public void ShowHistoryButtonChangesStateToHistoryState_Test()
        {
            StateFlowTests.InMainMenu(_context); // Start from main menu

            _buttons.ShowHistoryButton();
            Assert.AreEqual(typeof(HistoryState), _context.CurrentState.GetType());
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
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);
        }