예제 #1
0
        public IEnumerator CanClickNextButton_WhenRevistingCompletedPage_WhenItsCriteriaHaveBeenLaterInvalidated()
        {
            using (var automatedWindow = new AutomatedWindow <TutorialWindow>(m_Window))
            {
                m_Window.RepaintImmediately();

                // next button should be disabled
                automatedWindow.Click(FindElementWithText(automatedWindow, nextButtonText, "next button"));
                yield return(null);

                m_Window.RepaintImmediately();
                Assert.AreEqual(firstPage, m_Window.currentTutorial.currentPage);

                // complete criterion; next button should now be enabled
                firstPageCriterion.Complete(true);
                yield return(null);

                m_Window.RepaintImmediately();
                automatedWindow.Click(FindElementWithText(automatedWindow, nextButtonText, "next button"));
                yield return(null);

                m_Window.RepaintImmediately();
                Assert.AreEqual(secondPage, m_Window.currentTutorial.currentPage);

                // go back
                automatedWindow.Click(FindElementWithStyle(automatedWindow, m_Window.allTutorialStyles.backButton, "back button"));
                yield return(null);

                m_Window.RepaintImmediately();
                Assert.AreEqual(firstPage, m_Window.currentTutorial.currentPage);

                // invalidate criterion; next button should still be enabled
                firstPageCriterion.Complete(false);
                automatedWindow.Click(FindElementWithText(automatedWindow, nextButtonText, "next button"));
                yield return(null);

                m_Window.RepaintImmediately();
                Assert.AreEqual(secondPage, m_Window.currentTutorial.currentPage);
            }
        }