Пример #1
0
        private static void GetRegex()
        {
            string[]      stringfiedRegex = FakeServer.GetFakeServer().ReturnRegex();
            QueryVerifier queryVerifier   = QueryVerifier.GetQueryVerifier();

            for (int i = 0; i < stringfiedRegex.Length; i++)
            {
                queryVerifier.AddPattern(stringfiedRegex[i]);
            }
        }
Пример #2
0
        public static void DoTheTest(string filePath, string outFilePath)
        {
            StreamReader reader       = new StreamReader(filePath);
            int          numberOfTest = 1;
            string       textLine;
            string       result  = "# TEST" + numberOfTest + "\n";
            double       seconds = 0;
            double       diff;
            DateTime     date;

            while ((textLine = reader.ReadLine()) != null)
            {
                if (!textLine.Equals(""))
                {
                    if (QueryVerifier.GetQueryVerifier().EvaluateQuery(textLine))
                    {
                        date    = DateTime.Now;
                        result  = result + DirectRequester.GetRequester().SendRequest(TransactionCreator.GetTransactionCreator().CreateGroupDependingXML(QueryVerifier.GetQueryVerifier().queryMatch));
                        diff    = GetDiffAndAct(date, DateTime.Now);
                        result  = result + " (" + diff + "s)\n";
                        seconds = seconds + diff;
                    }
                    else
                    {
                        result = result + "bad sintax\n";
                    }
                }
                else
                {
                    numberOfTest = numberOfTest + 1;
                    result       = result + "TOTAL TIME:" + seconds + "s\n\n" + "# TEST " + numberOfTest + "\n";
                    seconds      = 0;
                }
            }
            result = result + "TOTAL TIME:" + seconds + "s";
            File.WriteAllText(outFilePath, result);
            Console.WriteLine(result);
            FakeServer.GetFakeServer().SaveShit();
        }
 public string SendRequest(string query)
 {
     return(FakeServer.GetFakeServer().ReceiveRequest(query));
 }