Ejemplo n.º 1
0
        public void http_client_adv()
        {
            var j = new JsonParser();

            string url      = "https://openbookmobile.etoro.com/api/login";
            string header   = @"Content-Type::application/x-www-form-urlencoded; charset=utf-8,, User-Agent::OpenBook/2.1 (iPad Simulator; iOS 7.1; Scale/2.00)";
            string mode     = "POST";
            string postdata = @"username=socialalert15&Password=123456m&appName=iOS&ver=2.1";
            string str      = "m=" + mode + " h=" + header + " u=" + url + " p=" + postdata;


            //string dbapiResult = HttpRequestExtensions.GetHTTPrequest(url);

            j.AddKeyToMemory(Constants.Memory, HttpRequestExtensions.GetHTTPrequestPost(str));

            string line = @"$$Token j= Token";

            j.VariableFunctions(line);

            str  = j.replaceVariable("$$Token");
            line = "https://openbookmobile.etoro.com/api/market?username=socialalert15&symbol=GOOG&appName=iOS&ver=2.1&period=180&code=en-gb&token=$$Token";
            j.AddKeyToMemory(Constants.Memory, HttpRequestExtensions.GetHTTPrequest(line));
            line = @"$$MarketValue j= MarketValue";
            j.VariableFunctions(line);
            str = j.replaceVariable("$$MarketValue");

            line = @"$$StockSummary j= StockSummary";
            j.VariableFunctions(line);
            str = j.replaceVariable("$$StockSummary");
        }
Ejemplo n.º 2
0
        public void VariableFunctionsCreateVar()
        {
            var     j   = new JsonParser();
            string  str = "$$test127 = AppiumServerHost";
            Boolean res = j.VariableFunctions(str);

            if (res)
            {
                str = "$$test127 .= SUPER";
                res = j.VariableFunctions(str);

                if (res)
                {
                    str = "$$test127 = $$test127 2 56 $$test127";
                    res = j.VariableFunctions(str);

                    if (res)
                    {
                        str = "$$test127 ~=  AppiumServerHost==>XXXX";
                        res = j.VariableFunctions(str);
                    }
                    if (res)
                    {
                        str = @"$$test127 ~= \d+";
                        res = j.VariableFunctions(str);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void http_client()
        {
            var j = new JsonParser();
            //string url = "https://fapi-real.etoro.com/instruments.json";
            string url = "https://fapi-real.etoro.com/instruments/1";

            //string dbapiResult = HttpRequestExtensions.GetHTTPrequest(url);

            j.AddKeyToMemory(Constants.Memory, HttpRequestExtensions.GetHTTPrequest(url));


            string line = @"$$instrumentData j= InstrumentName";

            j.VariableFunctions(line);

            string str = j.replaceVariable("$$instrumentData");


            j.VariableFunctions("$$DataSource = " + str);

            str = j.replaceVariable("$$memory");

            line = @"$$instrumentData j= InstrumentName ==> $$DataSource";
            j.VariableFunctions(line);
            str = j.replaceVariable("$$instrumentData");
        }
Ejemplo n.º 4
0
        public void sql_delete()
        {
            var j   = new JsonParser();
            var sql = new Sql();

            j.VariableFunctions("$$DataSource = Data Source=isr-sr-beaver;Integrated Security=True");
            j.VariableFunctions("$$InitialDataTable = Initial Catalog=QA_Autotest");
            j.VariableFunctions("$$db_cmd = DELETE FROM QA_Autotest.Test.GuiTagType  WHERE TagType='vsh'");

            string line   = @"s=$$DataSource t=$$InitialDataTable c=$$db_cmd";
            string db_out = sql.ExecuteCMDQuery(line);
        }
Ejemplo n.º 5
0
        public void sql_insert()
        {
            var j   = new JsonParser();
            var sql = new Sql();

            j.VariableFunctions("$$DataSource = Data Source=isr-sr-beaver;Integrated Security=True");
            j.VariableFunctions("$$InitialDataTable = Initial Catalog=QA_Autotest");
            j.VariableFunctions("$$db_cmd = INSERT INTO QA_Autotest.Test.GuiTagType(TagType) values('cmd')");

            string line   = @"s=$$DataSource t=$$InitialDataTable c=$$db_cmd";
            string db_out = sql.ExecuteCMDQuery(line);
        }
Ejemplo n.º 6
0
        public void sql_select()
        {
            var j   = new JsonParser();
            var sql = new Sql();

            j.VariableFunctions("$$DataSource = Data Source=isr-sr-beaver;Integrated Security=True");
            j.VariableFunctions("$$InitialDataTable = Initial Catalog=QA_Autotest");
            j.VariableFunctions("$$db_cmd = select * from [QA_Autotest].[Test].[GuiTagType]");

            string line   = @"s=$$DataSource t=$$InitialDataTable c=$$db_cmd";
            string db_out = sql.ExecuteCMDQuery(line);

            string[] data = Regex.Split(db_out, @"\n");

            foreach (string cmd in data)
            {
                string run_cmd = cmd;
            }
        }
Ejemplo n.º 7
0
        public void SSHtest()
        {
            var j   = new JsonParser();
            var ssh = new ssh_client();

            string  str = "$$ssh_connection = 10.10.90.229::dev::dev123456";
            Boolean res = j.VariableFunctions(str);

            string ssh_res = ssh.run_cmd("$$ssh_connection ==> ls -l /etc/,,uname -a");

            Console.Write(ssh_res);
        }
Ejemplo n.º 8
0
        public void VariableFunctionsMath()
        {
            var     j   = new JsonParser();
            string  str = "$$test127 = 200";
            Boolean res = j.VariableFunctions(str);

            if (res)
            {
                str = "$$test127 /= 2";
                res = j.VariableFunctions(str);

                Assert.AreEqual(true, res);
            }
            if (res)
            {
                str = "$$test127 *= 2";
                res = j.VariableFunctions(str);
            }
            if (res)
            {
                str = "$$test127 -=100";
                res = j.VariableFunctions(str);
            }
            if (res)
            {
                str = @"$$test127 += 100";
                res = j.VariableFunctions(str);
            }
            if (res)
            {
                str = @"$$test127 %= 3";
                res = j.VariableFunctions(str);
            }
        }