Exemplo n.º 1
0
        public MainPage()
        {
            Size                 = new Size(800, 600);
            StartPosition        = FormStartPosition.CenterScreen;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            MenuBar menubar = new MenuBar();

            menubar.menuBar();
            this.Controls.Add(menubar.menuBarStr);

            SearchBlock searchBox = new SearchBlock();

            searchBox.searchTextBox();
            this.Controls.Add(searchBox.search);

            SearchButton sButton = new SearchButton();

            sButton.searchButton();
            this.Controls.Add(sButton.searchB);

            SearchAllButton sAllButton = new SearchAllButton();

            sAllButton.searchAllButton();
            this.Controls.Add(sAllButton.searchAllB);
        }
Exemplo n.º 2
0
 public void MainTest()
 {
     MainPage.Navigate();
     MainPage.SignIn("*****@*****.**", "method");
     SearchBlock
     .OpenSearchBlock("Sleeve")
     .AddItem()
     .Checkout();
     Assert.That(MainPage.GetCompleteOrderMessage(), Is.EqualTo("Your order on My Store is complete."));
 }
Exemplo n.º 3
0
        private async Task <SearchBlock> CreateSearchBlock <T>(string title, Uri url, long totalCount,
                                                               IEnumerable <T> items,
                                                               Func <T, string> getTitle, Func <T, Uri> getUrl, Func <T, Task <string> > getDesc)
        {
            var block = new SearchBlock(title, url, totalCount);

            foreach (var item in items)
            {
                block.AddItem(getTitle(item), getUrl(item), await getDesc(item));
            }
            return(block);
        }
        protected SearchBlock CreateSearchBlock <T>(string title, Uri url, long totalCount,
                                                    IEnumerable <T> items,
                                                    Func <T, string> getTitle, Func <T, Uri> getUrl, Func <T, string> getDesc, Func <T, DateTimeOffset> getDate)
        {
            var block = new SearchBlock(title, url, totalCount);

            foreach (var item in items)
            {
                block.AddItem(getTitle(item), getUrl(item), getDesc(item), getDate(item));
            }

            return(block);
        }
Exemplo n.º 5
0
        public static void ProceedFileSystemFunc()
        {
            string file_system;

            string[] fields = new string[MAX_FILE_SYS_SIZE];
            bool[]   check_arr = new bool[MAX_FILE_SYS_SIZE];
            string   A, B, C, D;

            A = B = C = D = string.Empty;
            string[] search_value = new string[10];

            string file_name = "FileSystem.txt";

            if (File.Exists(file_name))
            {
                using (StreamReader reader = new StreamReader(file_name))
                    file_system = reader.ReadToEnd();
            }
            else
            {
                Console.BackgroundColor = ConsoleColor.Red;
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine($"File not exist{Environment.NewLine}");
                Console.BackgroundColor = ConsoleColor.Black;
                Console.ForegroundColor = ConsoleColor.Green;
                return;
            }

            string[] fils = file_system.Split(' ');

            int index = 0;

            for (int i = 0; fils[i] != "A"; i++)
            {
                fields[i]    = fils[i];
                check_arr[i] = false;
                index        = i;
            }

            for (int i = index; fils[i] != "EndOfFile"; i++)
            {
                switch (fils[i])
                {
                case "A":
                    A = fils[i + 1];
                    break;

                case "B":
                    B = fils[i + 1];
                    break;

                case "C":
                    C = fils[i + 1];
                    break;

                case "D":
                    D = fils[i + 1];
                    break;
                }
            }

            SearchBlock sb = (string block) =>
            {
                int temp = int.Parse(block);
                do
                {
                    block           = block + ' ' + fields[temp];
                    check_arr[temp] = true;
                    temp            = int.Parse(fields[temp]);
                }while (fields[temp] != "eof");

                check_arr[temp] = true;
                block           = block + ' ' + "eof";
                Console.WriteLine("A: " + block);
                return(block);
            };

            A = sb(A);
            B = sb(B);
            C = sb(C);
            D = sb(D);

            for (int i = 0; i < fields.Length; i++)
            {
                if (fields[i] == "bad")
                {
                    check_arr[i] = true;
                }
            }

            search_value = NotEmpty(check_arr, fields);
            string[] Splited = new string[3];
            for (int j = 0; j < 5; j++)
            {
                if (search_value[j] != "eof")
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("An unnamed part of the data was found. Written under the names E, F, G");
                    Console.WriteLine("E: " + search_value[j]);
                    Console.WriteLine("F: " + search_value[j + 2]);
                    Console.WriteLine("G: " + search_value[j + 3]);
                    break;
                }
            }
            IsEqual(A, B, C, D, fields);
        }
Exemplo n.º 6
0
 public LandingPage(IWebDriver driver) : base(driver)
 {
     SearchBlock = new SearchBlock(driver);
 }