Пример #1
0
        public override int ProcessFile(IEnumerable <string> dataStr)
        {
            foreach (string s in dataStr)
            {
                //Process lines with Driver and Trip. Discard everything else
                string[] fieldsStr = s.Split(FIELD_SEPARATOR_CHAR);
                if (fieldsStr.Length > 1)
                {
                    switch (fieldsStr[0])
                    {
                    case "Driver":
                        Driver.Add(fieldsStr, DriversList);
                        break;

                    case "Trip":
                        Trip.Add(fieldsStr, DriversList, TripsList);
                        break;

                    default:
                        //Unrecognized command, do nothing
                        break;
                    }
                }
            }

            Driver.CalculateAndClean(DriversList, TripsList);
            return(0);
        }
Пример #2
0
        public void SetUp()
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();

            Driver.Add(Configuration.Platform, Configuration.DriverPath, capabilities);
            Context.ClearCurrent();
        }
Пример #3
0
        public void SetUp()
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();

            Driver.Add(Configuration.Platform, Configuration.DriverPath, capabilities);
            home = PageFactory.Init <HomePage>();
            home.Navigate();
        }
Пример #4
0
 public void PositionCars()
 {
     Drivers.Add(new FarmerJoe(new Tractor()));
     Drivers.Add(new Antonio(new Minivan()));
     Drivers.Add(new SoccerMom(new Ford()));
     Driver.Add(new Mary(new Minivan()));
     Drivers.Add(new fouzia(Minivan()));
 }
Пример #5
0
        public void SetUp()
        {
            baseURL = Configuration.Get("BaseURL");
            ChromeOptions       options      = new ChromeOptions();
            DesiredCapabilities capabilities = new DesiredCapabilities();

            Driver.Add(Configuration.Get("Browser"), Path.GetFullPath("/home/wers4/Projects/UITesting/UITesting/chromedriver.exe"), capabilities);
            driver = Driver.Current();
            driver.Navigate().GoToUrl(baseURL);
        }
Пример #6
0
        public void SetUp()
        {
            baseURL = Configuration.Get("BaseURL");
            ChromeOptions       options      = new ChromeOptions();
            DesiredCapabilities capabilities = new DesiredCapabilities();

            Driver.Add(Configuration.Get("Browser"), Path.GetFullPath("/home/wers4/Projects/pw_shasta_wbi/pw_shasta_wbi"), capabilities);
            searchPage = PageFactory.Init <SearchPage>();
            searchPage.Navigate();
        }
Пример #7
0
        public void Setup()
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();

            capabilities.SetCapability("app", "/Users/salim/mtk_projects/ED/shoot/shootapp-xamarin/src/ShootApp.Droid/bin/Release/com.gunsandgame.ShootApp.apk");
            capabilities.SetCapability("platformVersion", "7.1.1");
            capabilities.SetCapability("platformName", "Android");
            capabilities.SetCapability("deviceName", "Any");

            Driver.Add(Configuration.Platform, Configuration.DriverPath, capabilities);
        }
Пример #8
0
        public override void ReadXml(XmlNode tag)
        {
            Name        = tag.Attributes["Name"].Value;
            Description = tag.Attributes["Description"].Value;
            Address     = tag.Attributes["Address"].Value;
//			Driver = DriverManager.Instance.GetDriver(tag.Attributes["Driver"].Value);

            Dsn        = tag.Attributes["Dsn"].Value;
            SqlCommand = tag.Attributes["SqlCommand"].Value;

            OnChange = bool.Parse(tag.Attributes["OnChange"].Value);
            OnOpen   = bool.Parse(tag.Attributes["OnOpen"].Value);
            OnClose  = bool.Parse(tag.Attributes["OnClose"].Value);

            foreach (XmlNode param in tag.ChildNodes)
            {
                DataRow nwRow = _sqlParams.NewRow();
                nwRow["Name"]  = param.Attributes["Name"].Value;
                nwRow["Value"] = param.Attributes["Value"].Value;
                _sqlParams.Rows.Add(nwRow);
            }

            if (!ServiceManager.DesignMode)
            {
                if (!ServiceManager.IsClient)
                {
                    Driver = DriverManager.Instance.GetDriver(tag.Attributes["Driver"].Value);
                    Driver.Add(Address);
                    //_value = Driver.GetValue(Address);
                }
                else
                {
                    Driver = DriverManager.Instance.GetDriver("FE9E907F-2186-4186-B5EA-53B7609303C0");
                }
            }
            else
            {
                Driver = DriverManager.Instance.GetDriver(tag.Attributes["Driver"].Value);
            }
        }
Пример #9
0
        public override void ReadXml(XmlNode tag)
        {
            Name        = tag.Attributes["Name"].Value;
            Description = tag.Attributes["Description"].Value;
            Address     = tag.Attributes["Address"].Value;
            Historical  = bool.Parse(tag.Attributes["Historical"].Value);

            OnOpenChk = tag.Attributes["OnOpenChk"] != null?bool.Parse(tag.Attributes["OnOpenChk"].Value) : OnOpenChk;

            OnOpenMsg  = tag.Attributes["OnOpenMsg"] != null ? tag.Attributes["OnOpenMsg"].Value : OnOpenMsg;
            OnCloseChk = tag.Attributes["OnCloseChk"] != null?bool.Parse(tag.Attributes["OnCloseChk"].Value) : OnCloseChk;

            OnCloseMsg = tag.Attributes["OnCloseMsg"] != null ? tag.Attributes["OnCloseMsg"].Value : OnCloseMsg;

            string fullPath     = Path.Combine(Path.GetDirectoryName(ServiceManager.OutputAssemblyFullPath), "Historical");
            string fullFileName = Path.Combine(fullPath, Name + ".xml");

            if (_dtHistorical == null && !ServiceManager.DesignMode)
            {
                DataColumn id = new DataColumn("Id");
                id.AutoIncrement     = true;
                id.AutoIncrementStep = 1;

                DataColumn value = new DataColumn("Value");
                value.DataType = typeof(string);

                DataColumn tmStamp = new DataColumn("TmStamp");
                tmStamp.DataType = typeof(DateTime);

                _dtHistorical = new DataTable(Name);
                _dtHistorical.Columns.AddRange(new DataColumn[] { id, value, tmStamp });

                _dtHistorical.PrimaryKey = new DataColumn[] { id };

                if (!Directory.Exists(fullPath))
                {
                    Directory.CreateDirectory(fullPath);
                }

                try
                {
                    if (File.Exists(fullFileName))
                    {
                        _dtHistorical.ReadXml(fullFileName);
                    }
                }
                catch (Exception)
                {
                    long ticks = DateTime.Now.Ticks;
                    File.Copy(fullFileName, fullFileName + "_error_" + ticks);
                }
            }

            try
            {
                if (!ServiceManager.DesignMode)
                {
                    if (!ServiceManager.IsClient)
                    {
                        Driver = DriverManager.Instance.GetDriver(tag.Attributes["Driver"].Value);
                        Driver.Add(Address);
                        //_value = Driver.GetValue(Address);
                    }
                    else
                    {
                        Driver = DriverManager.Instance.GetDriver("FE9E907F-2186-4186-B5EA-53B7609303C0");
                    }
                }
                else
                {
                    Driver = DriverManager.Instance.GetDriver(tag.Attributes["Driver"].Value);
                }
            }
            catch (Exception)
            {
                if (!ServiceManager.DesignMode)
                {
                    MessageBox.Show("A tag " + Name + " não pode se comunicar com a fonte da dados, favor verificar a comunicação");
                }
            }
        }
Пример #10
0
 private void AddDriver(Driver driver)
 {
     Driver.Add(driver);
 }