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()); }
public void ShowHistoryButtonChangesStateToHistoryState_Test() { StateFlowTests.InMainMenu(_context); // Start from main menu _buttons.ShowHistoryButton(); Assert.AreEqual(typeof(HistoryState), _context.CurrentState.GetType()); }
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); }
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); }
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); }
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); }