Esempio n. 1
0
        public void ClistElementsNeg()
        {
            string a;

            string    pathPageData     = $"{Environment.CurrentDirectory}\\..\\..\\Test\\DataForTest\\PageData.xml";
            string    pathButtonsState = $"{Environment.CurrentDirectory}\\..\\..\\Test\\DataForTest\\ButtonsState.xml";
            StartPage st = new StartPage(pathPageData, pathButtonsState);

            Assert.AreEqual(false, st.ClickAllButtons(out a));
        }
Esempio n. 2
0
        static void Main(string[] args)
        {

            //message to console
            string helloMessage = "Hello. Input 1 If you want to see all buttons on StartPage.\nInput 2 to click on all buttons";
            bool flagToExit = false;

            
            //page to work
            StartPage st = new StartPage();
            Console.WriteLine(helloMessage);

            //logic for console
            while (!flagToExit)
            {
                int inputtedNumber = ConsoleWorker.getIntegerValue("Input your number ");
                switch (inputtedNumber)
                {
                    case 1:
                        st.ShowAllButtonInConsole();
                        break;
                    case 2:
                        try
                        {
                            string resOfClick;
                            st.ClickAllButtons( out resOfClick);
                            Console.WriteLine(resOfClick);
                        } catch (FormatException ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        break;
                    default:
                        Console.WriteLine("You must input 1 or 2");
                        break;
                }

                //can create new method for this choice
                Console.WriteLine("Input n, if you whant exit.\nInput other symbol for return to programm ? (any line(y))/n");
                if (Console.ReadLine().ToUpper().Equals("N"))
                {
                    flagToExit = true;
                }
                
            }
           Console.WriteLine("Good by");
           Console.ReadLine();
        }
Esempio n. 3
0
        public void ClistElementsPos()
        {
            string a;

            Button bt1 = new Button("B1", true);
            Button bt2 = new Button("B2", true);
            Button bt3 = new Button("B3", true);

            List <Button> listButtonCorrect = new List <Button>();

            listButtonCorrect.Add(bt1);
            listButtonCorrect.Add(bt2);
            listButtonCorrect.Add(bt3);

            List <Button> listButtonForClick = new List <Button>();

            listButtonForClick.Add(bt1);
            listButtonForClick.Add(bt2);
            listButtonForClick.Add(bt3);

            StartPage st = new StartPage(listButtonCorrect, listButtonForClick);

            Assert.AreEqual(true, st.ClickAllButtons(out a));
        }