Beispiel #1
0
        public void NumberPanelInfiniteItemsTest()
        {
            using (var setup = new TestSetupHelper("PagerControl Tests"))
            {
                elements = new PagerControlTestPageElements();

                VerifyPageChanged(0);

                SetNumberPanelDisplayMode();
                VerifyNumberPanelDisplayMode();

                elements.GetEnterInfinityModeButton().Click();

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(1);
                VerifyNumberPanelContent("12345");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(2);
                VerifyNumberPanelContent("12345");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(3);
                VerifyNumberPanelContent("1More345");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(4);
                VerifyNumberPanelContent("1More456");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(5);
                VerifyNumberPanelContent("1More567");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(6);
                VerifyNumberPanelContent("1More678");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(7);
                VerifyNumberPanelContent("1More789");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(8);
                VerifyNumberPanelContent("1More8910");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(9);
                VerifyNumberPanelContent("1More91011");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(10);
                VerifyNumberPanelContent("1More101112");
            }
        }
Beispiel #2
0
        public void NumberBoxInfinityModeTest()
        {
            using (var setup = new TestSetupHelper("PagerControl Tests"))
            {
                elements = new PagerControlTestPageElements();

                SetNumberBoxDisplayMode();
                VerifyNumberBoxDisplayMode();
                VerifyPageChanged(0);
                elements.GetEnterInfinityModeButton().Click();

                SendValueToNumberBox("3"); // Note: PagerControl displays numbers starting at 1 but the page changed event sends 0-based numbers
                VerifyPageChanged(2);

                SendValueToNumberBox("1");
                VerifyPageChanged(0);

                SendValueToNumberBox("5");
                VerifyPageChanged(4);

                SendValueToNumberBox("2");
                VerifyPageChanged(1);

                SendValueToNumberBox("100");
                Verify.AreEqual("100", FindTextBox(elements.GetPagerNumberBox()).GetText());
                VerifyPageChanged(99);

                SendValueToNumberBox("10000");
                Verify.AreEqual("10000", FindTextBox(elements.GetPagerNumberBox()).GetText());
                VerifyPageChanged(9999);

                SendValueToNumberBox("-100");
                Verify.AreEqual("1", FindTextBox(elements.GetPagerNumberBox()).GetText());
                VerifyPageChanged(0);
            }
        }