Example #1
0
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string redirectURL = GenericFunctions.GetRedirectURL(this.Request);
         UIConstantStrings.SettingsPageQueryString = Request.Url.Query; // Stores the query string in a variable and used the variable for redirection as a fix for code analyzer warning.
         if (!string.IsNullOrWhiteSpace(Request.Url.Query))
         {
             redirectURL = string.Concat(redirectURL, UIConstantStrings.SettingsPageQueryString);
         }
         GenericFunctions.SetConstantsResponse(this.Request, this.Response, redirectURL, ConstantStrings.ConstantObjectForSettings, ConstantStrings.ConstantFileForSettings);
     }
     catch (Exception exception)
     {
         string response = Logger.LogError(exception, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, UIConstantStrings.LogTableName);
         Response.Write(GenericFunctions.SetErrorResponse(ConstantStrings.TRUE, response));
     }
 }
    void LookAtTarget()   // rotate head to look at crosshair
    {
        float maxRotUp   = dimaScript.spriteRotation == 1 ? 125 : 240;
        float maxRotDown = dimaScript.spriteRotation == 1 ? 412 : 300;

        Quaternion lookRot     = GenericFunctions.GetLookRotation(crosshair, transform);
        Vector3    adjustedRot = lookRot.eulerAngles;

        adjustedRot = new Vector3(0, 0, adjustedRot.z + 90);

        if (dimaScript.spriteRotation != latestSpriteRot)
        {
            if (latestRot.z <= 92 || latestRot.z <= 240)
            {
                latestRot.z = dimaScript.spriteRotation == 1 ? latestRot.z + 230 : latestRot.z - 230; // TODO: adjust thse more precicely
            }
            else if (adjustedRot.z >= 450 || adjustedRot.z >= 300)
            {
                latestRot.z = dimaScript.spriteRotation == 1 ? latestRot.z + 100 : latestRot.z - 100; // TODO: adjust thse more precicely
            }
            latestSpriteRot = dimaScript.spriteRotation;
        }

        if (dimaScript.spriteRotation == 1)
        {
            latestRot = new Vector3(0, 0, Mathf.Abs(latestRot.z));
        }
        else
        {
            transform.rotation = Quaternion.Euler(new Vector3(0, 0, -transform.rotation.z));
        }

        if (dimaScript.spriteRotation == 1 && adjustedRot.z >= 92 && adjustedRot.z <= 125 ||
            dimaScript.spriteRotation == 1 && adjustedRot.z <= 450 && adjustedRot.z >= 412)
        {
            latestRot = adjustedRot;
        }
        else if (dimaScript.spriteRotation == -1 && adjustedRot.z >= 240 && adjustedRot.z <= 300)
        {
            latestRot = adjustedRot;
        }

        transform.rotation = Quaternion.Euler(latestRot);
    }
        /// <summary>
        /// Reads the xml document and populates internal state with its data.
        /// </summary>
        /// <param name="xmlDocument">Xml document</param>
        public void ReadXml(XmlDocument xmlDocument)
        {
            if (xmlDocument.DocumentElement.ChildNodes != null)
            {
                //Iterates thru each node in HattrickData node
                foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes)
                {
                    bool generalNode = false;
                    switch (xmlNode.Name)
                    {
                    case Tags.FileName: {
                        this.fileNameField = xmlNode.InnerText;
                        generalNode        = true;
                        break;
                    }

                    case Tags.Version: {
                        this.versionField = GenericFunctions.ConvertStringToDecimal(xmlNode.InnerText);
                        generalNode       = true;
                        break;
                    }

                    case Tags.UserID: {
                        this.userIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                        generalNode      = true;
                        break;
                    }

                    case Tags.FetchedDate: {
                        this.fetchedDateField = GenericFunctions.ConvertStringToDateTime(xmlNode.InnerText);
                        generalNode           = true;
                        break;
                    }
                    }

                    if (!generalNode)
                    {
                        // Not one of the general nodes,
                        // try reading it as a specific node
                        //ReadSpecificNode(xmlNode);
                    }
                }
            }
        }
Example #4
0
        public static void NavigateAroundAnotherSite()
        {
            driver = new ChromeDriver();
            driver.Manage().Window.Maximize();

            //Go to Training HTML
            driver.Navigate().GoToUrl("file:///C:/Ranjit/Automation/TrainingTasks/IntroductionToAutomation/Testng.html");
            GenericFunctions.Wait(2);

            //Click on a hyperlink
            GenericFunctions.ClickOnLink("Click Me", driver);
            GenericFunctions.Wait(2);

            //Navigate Back
            driver.Navigate().Back();
            GenericFunctions.Wait(2);

            //Select a value from a Dropdown
            GenericFunctions.SelectFromList("Audi", "CarsList", driver);
            GenericFunctions.Wait(2);

            //Tick / Untick a checkbox
            GenericFunctions.TickCheckBox("Bike", driver);
            GenericFunctions.Wait(2);
            GenericFunctions.UnTickCheckBox("Bike", driver);
            GenericFunctions.Wait(2);

            //Check text is on a page.
            GenericFunctions.CheckTextIsOnPageNew("Login", driver);
            GenericFunctions.CheckTextIsOnPageNew("Username:"******"Password:"******"What transport do you have?", driver);
            GenericFunctions.CheckTextIsOnPageNew("What car do you have?", driver);

            //Check text is not on a page.
            GenericFunctions.CheckTextIsNotOnPageNew("Elephant", driver);
            GenericFunctions.CheckTextIsNotOnPageNew("Tiger", driver);
            GenericFunctions.CheckTextIsNotOnPageNew("Dog", driver);
            GenericFunctions.CheckTextIsNotOnPageNew("Cat", driver);

            //Close Browser
            GenericFunctions.Wait(2);
            driver.Quit();
        }
    // Update is called once per frame
    private void FixedUpdate()
    {
        Vector3 position = transform.position;

        // Find closest enemy, if no enemy is currently stored in _closestEnemy
        if (_closestEnemy == null)
        {
            // ReSharper disable once Unity.PerformanceCriticalCodeInvocation
            _closestEnemy = GenericFunctions.FindClosestEnemy(transform.position);

            // If _closestEnemy is still null, it means nothing new was found
            if (_closestEnemy == null)
            {
                Destroy(gameObject);
                return;
            }
        }

        _cooldownTimer -= Time.deltaTime;

        if (_cooldownTimer <= 0)
        {
            // Rotate missile towards closest enemy
            Vector3 target   = _closestEnemy.transform.position;
            float   angle    = Mathf.Atan2(target.y - position.y, target.x - position.x) * 180 / Mathf.PI;
            Vector3 rotation = new Vector3(0, 0, angle);

            transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(rotation), Time.deltaTime * 10f);
        }

        // Move forward
        Vector3 impulse = new Vector3(movementForce, 0, 0);

        _rb.AddRelativeForce(impulse, ForceMode2D.Impulse);

        // Self destruct after n seconds
        _selfDestructTimer -= Time.deltaTime;

        // Also self-destruct if hits the edge of the bubble
        if (_selfDestructTimer <= 0 || Vector3.Distance(_closestCenter, position) > 12f)
        {
            Destroy(gameObject);
        }
    }
        private AwayTeam ParseAwayTeamNode(XmlNode awayTeamNode)
        {
            AwayTeam awayTeam = new AwayTeam();

            foreach (XmlNode xmlNodeAwayTeam in awayTeamNode.ChildNodes)
            {
                switch (xmlNodeAwayTeam.Name)
                {
                case Tags.AwayTeamID:
                    awayTeam.awayTeamIdField = GenericFunctions.ConvertStringToUInt(xmlNodeAwayTeam.InnerText);
                    break;

                case Tags.AwayTeamName:
                    awayTeam.awayTeamNameField = xmlNodeAwayTeam.InnerText;
                    break;
                }
            }
            return(awayTeam);
        }
Example #7
0
        public static int GetRowIdForSubject(int subjectid, IWebDriver driver)
        {
            var returninternalsubjectid = 0;

            using (var conn = new SqlConnection(GenericFunctions.goAndGet("DBCONNECTION")))
            {
                conn.Open();
                using (var command = new SqlCommand("select subject_id from tbl_subject where user_subject_id = '" + subjectid + "' AND site_id = '" + GetSiteID(driver) + "'"))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;
                    var obj = command.ExecuteScalar();
                    returninternalsubjectid = Convert.ToInt32(obj.ToString());
                }

                conn.Close();
                return(returninternalsubjectid);
            }
        }
Example #8
0
        public static int GetStudyId(IWebDriver driver)
        {
            using (SqlConnection conn = new SqlConnection(GenericFunctions.goAndGet("DBCONNECTION")))
            {
                conn.Open();
                int StudyID;
                using (var command = new SqlCommand("SELECT study_id from tbl_study where name = '" + GenericFunctions.goAndGet("STUDYID") + "'"))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;
                    var obj = command.ExecuteScalar();
                    StudyID = Convert.ToInt32(obj.ToString());
                }

                conn.Close();

                return(StudyID);
            }
        }
        protected override void ParseSpecificNode(System.Xml.XmlNode xmlNode, HM.Entities.Hattrick.HattrickBase entity)
        {
            LeagueDetails leagueDetails = (LeagueDetails)entity;

            switch (xmlNode.Name)
            {
            case Tags.LeagueID:
                leagueDetails.leagueIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                break;

            case Tags.LeagueName:
                leagueDetails.leagueNameField = xmlNode.InnerText;
                break;

            case Tags.LeagueLevel:
                leagueDetails.leagueLevelField = GenericFunctions.ConvertStringToByte(xmlNode.InnerText);
                break;

            case Tags.MaxLevel:
                leagueDetails.maxLevelField = GenericFunctions.ConvertStringToByte(xmlNode.InnerText);
                break;

            case Tags.LeagueLevelUnitID:
                leagueDetails.leagueLevelUnitIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                break;

            case Tags.LeagueLevelUnitName:
                leagueDetails.leagueLevelUnitNameField = xmlNode.InnerText;
                break;

            case Tags.CurrentMatchRound:
                leagueDetails.currentMatchRound = GenericFunctions.ConvertStringToByte(xmlNode.InnerText);
                break;

            case Tags.Team:
                Team newTeam = ParseTeamNode(xmlNode);
                leagueDetails.teamField[newTeam.positionField - 1] = newTeam;
                break;

            default:
                throw new Exception(string.Format("Invalid XML: LeagueDetails.xml", Tags.Team));
            }
        }
        private Team ParseTeamNode(XmlNode teamArrayNode)
        {
            Team team = new Team();

            foreach (XmlNode teamNode in teamArrayNode.ChildNodes)
            {
                switch (teamNode.Name)
                {
                case Tags.TeamID:
                    team.teamIdField = GenericFunctions.ConvertStringToUInt(teamNode.InnerText);
                    break;

                case Tags.TeamName:
                    team.teamNameField = teamNode.InnerText;
                    break;

                case Tags.Position:
                    team.positionField = GenericFunctions.ConvertStringToByte(teamNode.InnerText);
                    break;

                case Tags.PositionChange:
                    team.positionChangeField = (PositionChange)Convert.ToInt32(teamNode.InnerText);
                    break;

                case Tags.Matches:
                    team.matchesField = GenericFunctions.ConvertStringToByte(teamNode.InnerText);
                    break;

                case Tags.GoalsFor:
                    team.goalsForField = GenericFunctions.ConvertStringToByte(teamNode.InnerText);
                    break;

                case Tags.GoalsAgainst:
                    team.goalsAgainstField = GenericFunctions.ConvertStringToByte(teamNode.InnerText);
                    break;

                case Tags.Points:
                    team.pointsField = GenericFunctions.ConvertStringToByte(teamNode.InnerText);
                    break;
                }
            }
            return(team);
        }
Example #11
0
        private Country ParseCountryNode(XmlNode countryNode)
        {
            try
            {
                Country country = new Country();

                foreach (XmlNode xmlNode in countryNode.ChildNodes)
                {
                    switch (xmlNode.Name)
                    {
                    case Tags.CountryID:
                    {
                        country.countryIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                        break;
                    }

                    case Tags.CountryName:
                    {
                        country.countryNameField = xmlNode.InnerText;
                        break;
                    }

                    case Tags.CurrencyName:
                    {
                        country.currencyNameField = xmlNode.InnerText;
                        break;
                    }

                    case Tags.CurrencyRate:
                    {
                        country.currencyRateField = GenericFunctions.ConvertStringToDecimal(xmlNode.InnerText);
                        break;
                    }
                    }
                }

                return(country);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #12
0
 /// <summary>
 /// Sets selected league data to the controls
 /// </summary>
 /// <param name="selectedLeague">Selected league id</param>
 private void SetSelectedLeagueInfo(HM.Entities.Hattrick.WorldDetails.League selectedLeague)
 {
     pictureBoxFlag.Image           = GenericFunctions.GetFlagByLeagueId(selectedLeague.leagueIdField);
     linkLabelLeague.Text           = selectedLeague.leagueNameField;
     labelEnglishNameValue.Text     = selectedLeague.englishNameField;
     labelZoneNameValue.Text        = selectedLeague.zoneNameField;
     labelCurrencyNameValue.Text    = selectedLeague.countryField.currencyNameField;
     labelCurrencyRateValue.Text    = selectedLeague.countryField.currencyRateField.ToString();
     labelLeagueSeasonValue.Text    = selectedLeague.seasonField.ToString();
     labelMatchRoundValue.Text      = selectedLeague.matchRoundField.ToString();
     labelLeagueLevelsValue.Text    = selectedLeague.numberOfLevelsField.ToString();
     labelActiveUsersValue.Text     = selectedLeague.activeUsersField.ToString("N0");
     labelWaitingUsersValue.Text    = selectedLeague.waitingUsersField.ToString("N0");
     labelCupNameValue.Text         = selectedLeague.cupField.cupNameField.ToString();
     labelTrainingDateValue.Text    = GetEventTimeString(selectedLeague.trainingDateField);
     labelEconomyDateValue.Text     = GetEventTimeString(selectedLeague.economyDateField);
     labelCupMatchDateValue.Text    = GetEventTimeString(selectedLeague.cupMatchDateField);
     labelSeriesMatchDateValue.Text = GetEventTimeString(selectedLeague.seriesMatchDateField);
 }
Example #13
0
        private void LoadFixturesGrid()
        {
            DataTable fixturesDataTable = new DataTable();

            fixturesDataTable.Columns.Add(Columns.Round, typeof(byte));
            fixturesDataTable.Columns.Add(Columns.MatchDate, typeof(string));
            fixturesDataTable.Columns.Add(Columns.HomeResult, typeof(Image));
            fixturesDataTable.Columns.Add(Columns.HomeTeamID, typeof(uint));
            fixturesDataTable.Columns.Add(Columns.HomeTeam, typeof(string));
            fixturesDataTable.Columns.Add(Columns.Score, typeof(string));
            fixturesDataTable.Columns.Add(Columns.AwayTeamID, typeof(uint));
            fixturesDataTable.Columns.Add(Columns.AwayTeam, typeof(string));
            fixturesDataTable.Columns.Add(Columns.AwayResult, typeof(Image));

            foreach (HTEntities.LeagueFixtures.Match match in leagueFixtures.matchListField)
            {
                DataRow newDataRow = fixturesDataTable.NewRow();

                newDataRow[Columns.Round]      = match.matchRoundField;
                newDataRow[Columns.MatchDate]  = match.matchDateField.ToString(General.DateTimeFormat);
                newDataRow[Columns.HomeTeamID] = match.homeTeamField.homeTeamIdField;
                newDataRow[Columns.HomeTeam]   = match.homeTeamField.homeTeamNameField;
                newDataRow[Columns.Score]      = string.Format(General.Score, match.homeGoalsField, match.awayGoalsField);
                newDataRow[Columns.AwayTeamID] = match.awayTeamField.awayTeamIdField;
                newDataRow[Columns.AwayTeam]   = match.awayTeamField.awayTeamNameField;

                if (match.matchDateField < leagueFixtures.fetchedDateField)
                {
                    newDataRow[Columns.HomeResult] = GenericFunctions.GetResultImage(match.homeGoalsField, match.awayGoalsField, TeamLocation.Home);
                    newDataRow[Columns.AwayResult] = GenericFunctions.GetResultImage(match.homeGoalsField, match.awayGoalsField, TeamLocation.Away);
                }
                else
                {
                    newDataRow[Columns.HomeResult] = HM.Resources.Properties.Resources.Grey;
                    newDataRow[Columns.AwayResult] = HM.Resources.Properties.Resources.Grey;
                }

                fixturesDataTable.Rows.Add(newDataRow);
            }

            dataGridViewFixtures.DataSource = fixturesDataTable;
        }
Example #14
0
        public static void CheckTblSubject(int subjectId, string siteName, string studyName, IWebDriver driver)
        {
            using (SqlConnection conn = new SqlConnection(GenericFunctions.goAndGet("DBCONNECTION")))
            {
                conn.Open();

                using (SqlCommand command = new SqlCommand("select subject_id from tbl_subject where user_subject_id = '" + subjectId + "' AND Site_ID = '" + GetSiteID(driver) + "'"))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;

                    Object obj = command.ExecuteScalar();
                    subjectId = Convert.ToInt32(obj.ToString());;
                }


                System.Console.WriteLine("Checked tbl_subjects. Subject " + subjectId + " exists.");

                using (SqlCommand command = new SqlCommand("SELECT COUNT(outbound_msg_id) AS count FROM tbl_outbound_msg WHERE subject_id = '" + subjectId + "'"))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;



                    Object obj      = command.ExecuteScalar();
                    int    messages = Convert.ToInt32(obj.ToString());

                    if (messages == Convert.ToInt32(GenericFunctions.goAndGet("MESSAGES")))
                    {
                        GenericFunctions.ReportTheTestPassed("Subject " + subjectId + " contains the correct number of messages: " + messages);
                    }
                    else
                    {
                        GenericFunctions.ReportTheTestFailed("Subject " + subjectId + " contained " + messages + " messages, but " + Convert.ToInt32(GenericFunctions.goAndGet("MESSAGES")) + " were expected.");
                        _startUp.stepsFailed++;
                    }
                }

                conn.Close();
            }
        }
        private Cup ParseCupNode(XmlNode cupNode)
        {
            try {
                Cup cup = new Cup();

                foreach (XmlNode xmlNode in cupNode.ChildNodes)
                {
                    switch (xmlNode.Name)
                    {
                    case Tags.StillInCup:
                        cup.stillInCupField = GenericFunctions.ConvertStringToBool(xmlNode.InnerText);
                        break;
                    }
                }

                return(cup);
            } catch (Exception ex) {
                throw ex;
            }
        }
Example #16
0
        private static int GetSiteID(IWebDriver driver)
        {
            using (var conn = new SqlConnection(GenericFunctions.goAndGet("DBCONNECTION")))
            {
                conn.Open();

                int siteId;
                using (var command = new SqlCommand("SELECT site_id from tbl_site where study_id = '" + GetStudyId(driver) + "'"))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;

                    Object obj = command.ExecuteScalar();
                    siteId = Convert.ToInt32(obj.ToString());
                }
                conn.Close();

                return(siteId);
            }
        }
Example #17
0
        public static string GetQueryResult(string sSQL)
        {
            //This function can only be used to return single pieces of data from an SQL query.  IE.  it won't return multiple columns\rows.
            Console.WriteLine("GetQueryResult Starting Function:  sSQL=  " + sSQL);
            string sResult;

            using (var conn = new SqlConnection(GenericFunctions.goAndGet("DBCONNECTION")))
            {
                conn.Open();
                using (var command = new SqlCommand(sSQL))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;
                    var obj = command.ExecuteScalar();
                    sResult = obj.ToString();
                }
                conn.Close();
                return(sResult);
            }
        }
        private Trainer ParseTrainerNode(XmlNode trainerNode)
        {
            try {
                Trainer trainer = new Trainer();

                foreach (XmlNode xmlNode in trainerNode.ChildNodes)
                {
                    switch (xmlNode.Name)
                    {
                    case Tags.PlayerID:
                        trainer.playerIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                        break;
                    }
                }

                return(trainer);
            } catch (Exception ex) {
                throw ex;
            }
        }
        private BotStatus ParseBotStatusNode(XmlNode botStatusNode)
        {
            try {
                BotStatus botStatus = new BotStatus();

                foreach (XmlNode xmlNode in botStatusNode.ChildNodes)
                {
                    switch (xmlNode.Name)
                    {
                    case Tags.IsBot:
                        botStatus.isBotField = GenericFunctions.ConvertStringToBool(xmlNode.InnerText);
                        break;
                    }
                }

                return(botStatus);
            } catch (Exception ex) {
                throw ex;
            }
        }
        private Guestbook ParseGuestbookNode(XmlNode guestbookNode)
        {
            try {
                Guestbook guestbook = new Guestbook();

                foreach (XmlNode xmlNode in guestbookNode.ChildNodes)
                {
                    switch (xmlNode.Name)
                    {
                    case Tags.NumberOfGuestbookItems:
                        guestbook.numberOfGuestbookItemsField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                        break;
                    }
                }

                return(guestbook);
            } catch (Exception ex) {
                throw ex;
            }
        }
Example #21
0
    void Start()
    {
        StartCoroutine(GenericFunctions.FadeOutImage(.5f, fadeImage, 1f));
        //Invoke("EnableMenuButtons", delay + 3);

        for (int i = 0; i < animations.Count; i++)
        {
            animations[i].gameObject.SetActive(false);
        }
        StartCoroutine(PlayMainMenuAnimation(animations[0], delay + 1.5f));
        StartCoroutine(PlayMainMenuAnimation(animations[1], delay + 2.25f));

        StartCoroutine(PlayMainMenuAnimation(animations[2], delay + 3.25f));
        StartCoroutine(PlayMainMenuAnimation(animations[3], delay + 3.50f));
        StartCoroutine(PlayMainMenuAnimation(animations[4], delay + 3.75f));

        audioSource.PlayDelayed(.3f);
        StartCoroutine(GenericFunctions.FadeInSound(.4f, audioSource, 1f, .5f));
        StartCoroutine(GenericFunctions.FadeInImage(1.25f, imageGGJ, delay + 5f));
    }
        private HomeTeam ParseHomeTeamNode(XmlNode homeTeamNode)
        {
            HomeTeam homeTeam = new HomeTeam();

            foreach (XmlNode xmlNode in homeTeamNode.ChildNodes)
            {
                switch (xmlNode.Name)
                {
                case Tags.HomeTeamID:
                    homeTeam.homeTeamIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                    break;

                case Tags.HomeTeamName:
                    homeTeam.homeTeamNameField = xmlNode.InnerText;
                    break;
                }
            }

            return(homeTeam);
        }
        private Team ParseTeamNode(XmlNode teamNode)
        {
            try
            {
                Team team = new Team();

                foreach (XmlNode xmlNode in teamNode.ChildNodes)
                {
                    switch (xmlNode.Name)
                    {
                    case Tags.TeamID:
                        team.teamIdField = GenericFunctions.ConvertStringToUInt(xmlNode.InnerText);
                        break;

                    case Tags.TeamName:
                        team.teamNameField = xmlNode.InnerText;
                        break;

                    case Tags.Specialists:
                        if (xmlNode.ChildNodes != null)
                        {
                            team.specialistsField = ParseSpecialistsNode(xmlNode);
                        }
                        break;

                    case Tags.YouthSquad:
                        if (xmlNode.ChildNodes != null)
                        {
                            team.youthSquadField = ParseYouthSquadNode(xmlNode);
                        }
                        break;
                    }
                }

                return(team);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static void ITC_EditSubject(int SubjectID, IWebDriver driver)
        {
            string StudyName = GenericFunctions.goAndGet("STUDYID");
            string SiteName  = GenericFunctions.goAndGet("SITEID");

            GenericFunctions.ClickOnButton("editBtn", driver);
            GenericFunctions.Wait(5);
            Functions.Reporting.ReportScreenshot("Edit_", driver);
            GenericFunctions.Clear("SubjectEMail", driver);
            GenericFunctions.Type(SubjectID + "@email-modified.com", "SubjectEMail", driver);

            //ClickElement(driver.FindElement(By.XPath("//*[@id=\"patientEditSaveButton\"]/span")));
            GenericFunctions.ClickElement(driver.FindElement(By.XPath("//*[@id=\"patientEditSaveButton\"]")), driver);
            GenericFunctions.Wait(20);

            var InputtedSecretQuestion = "In what city or town does your nearest sibling live?";
            var getSecretQuestion      = driver.FindElement(By.Id("Patient_SecurityQuestion")).GetAttribute("value");
            //var getSecretQuestion = driver.FindElement(By.Id("SecurityQuestionDropDownList")).GetAttribute("value");

            var InputtedSecretQuestionAnswer = "Nottingham";
            var getSecretQuestionAnswer      = driver.FindElement(By.Id("Patient_SecurityQuestionAnswer")).GetAttribute("value");

            if (getSecretQuestion.Equals(InputtedSecretQuestion) && (getSecretQuestionAnswer.Equals(InputtedSecretQuestionAnswer)))
            {
                GenericFunctions.ReportTheTestPassed("The secret question (" + getSecretQuestion + ") and secret answer (" + getSecretQuestionAnswer + ")  are correct ");
                _startUp.TestPasses++;
                _startUp.Passes++;
            }
            else
            {
                GenericFunctions.ReportTheTestFailed("The secret question is incorrect. The expected question is: " + InputtedSecretQuestion + "The actual question is: " + getSecretQuestion);
                GenericFunctions.ReportTheTestFailed("The secret question answer is incorrect. The expected question answer is: " + InputtedSecretQuestionAnswer + "The actual question is: " + getSecretQuestionAnswer);
                _startUp.TestFails++;
                _startUp.Fails++;
            }

            GenericFunctions.Wait(2);
            GenericFunctions.ClickOnLink("Subject Administration", driver);
            GenericFunctions.Wait(5);
            Functions.Reporting.ReportScreenshot("Edit", driver);
        }
        protected override void ParseSpecificNode(XmlNode xmlNode, HattrickBase entity)
        {
            Matches matches = (Matches)entity;

            switch (xmlNode.Name)
            {
            case Tags.IsYouth:
                matches.isYouth = GenericFunctions.ConvertStringToBool(xmlNode.InnerText);
                break;

            case Tags.Team:
                if (xmlNode.ChildNodes != null)
                {
                    matches.team = ParseTeamNode(xmlNode);
                }
                break;

            default:
                throw new Exception(string.Format("Invalid XML: Matches.xml", Tags.Team));
            }
        }
Example #26
0
    private void Start()
    {
        titleText.GetComponent <VertexJitter>().ShakeText();
        player1SelectionIndex = 0;
        player2SelectionIndex = characters.Count - 1;

        for (int i = 0; i < selectorsPlayer1.Count; i++)
        {
            selectorsPlayer1[i].gameObject.SetActive(false);
            selectorsPlayer2[i].gameObject.SetActive(false);
        }

        selectorsPlayer1[player1SelectionIndex].gameObject.SetActive(true);
        selectorsPlayer2[player2SelectionIndex].gameObject.SetActive(true);

        this.characterOptionsP1[player1SelectionIndex].SetActive(true);
        this.characterOptionsP2[player2SelectionIndex].SetActive(true);

        timer = maxTimeToSelect;
        StartCoroutine(GenericFunctions.FadeInSound(.5f, audioSource, 1f, .5f));
    }
Example #27
0
        public static string GetMessageStatus(string number, string date, IWebDriver driver)
        {
            using (var conn = new SqlConnection(GenericFunctions.goAndGet("ATLASDBCONNECTION")))
            {
                //date format for query must be yyyy-mm-dd hh:mm:ss.msmsms e.g. 2015-06-16 15:30:00.000
                conn.Open();

                string messageStatus;
                using (var command = new SqlCommand("SELECT a.name FROM [dbo].[tlkp_aggregator_status] AS a INNER JOIN [dbo].[tbl_sms_out] AS so ON a.status_id = so.aggregator_status_ind WHERE so.schedule_time_gmt = '" + date + "' AND dbo.func_aes256_decrypt(so.enc_msisdn_enc) = '" + number + "'"))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    command.Connection  = conn;

                    Object obj = command.ExecuteScalar();
                    messageStatus = obj.ToString();
                }
                conn.Close();

                return(messageStatus);
            }
        }
Example #28
0
        public static void TrainingTest()
        {
            driver = new ChromeDriver();
            driver.Manage().Window.Maximize();

            // Load the test page
            driver.Navigate().GoToUrl("https://bbc.co.uk");
            GenericFunctions.ClickOnLink("Sport", driver);
            GenericFunctions.ClickOnLink("About the BBC", driver);
            //GenericFunctions.UnTickCheckBox
            GenericFunctions.Wait(5);
            driver.Quit();

            //Type
            //TickCheckBox
            //UnTickCheckbox - By.Id
            //SelectFromList
            //ClickOnButton
            //ClickOnLink
            //CheckTextIsOnPage
            //CheckTextIsNotOnPage
        }
Example #29
0
    void LaserFireController()
    {
        float baseVolume = isDeathLaser ? 0.4f : 0.4f;
        float distance   = GenericFunctions.GetDistance(middlePointObject, Dima);

        distance = distance > 100 ? 100 : distance;
        laserFireAudio.volume = baseVolume - (distance / 60);

        if (isDeathLaser)
        {
            beam_D.SetActive(laserOn);
            laserFireAudio.clip = laserFireSounds[0];
        }
        else
        {
            if (overlord.alarmOn)
            {
                beam_A2.SetActive(laserOn);
                beam_A1.SetActive(false);
            }
            else
            {
                beam_A1.SetActive(laserOn);
                beam_A2.SetActive(false);
            }
            laserFireAudio.clip = laserFireSounds[1];
        }
        if (laserOn && !playingFireAudio)
        {
            laserFireAudio.Play();
            playingFireAudio = true;
        }
        else if (!laserOn)
        {
            laserFireAudio.Stop();
            playingFireAudio = false;
        }
        LaserBalls();
    }
        protected override void ParseSpecificNode(XmlNode xmlNode, HattrickBase entity)
        {
            try {
                MatchesArchive matchesArchive = (MatchesArchive)entity;

                switch (xmlNode.Name)
                {
                case Tags.IsYouth:
                    matchesArchive.isYouthField = GenericFunctions.ConvertStringToBool(xmlNode.InnerText);
                    break;

                case Tags.Team:
                    if (xmlNode.ChildNodes != null)
                    {
                        matchesArchive.teamField = ParseTeamNode(xmlNode);
                    }
                    break;
                }
            } catch (Exception ex) {
                throw ex;
            }
        }