Example #1
0
 /* Refused, seems bad to me
  * delegate void SalesmanAlgo();
  * private void Universal_Click(object sender, EventArgs e)
  * {
  *  SalesmanAlgo[] algorithm = { RunGeneticAlgorithmAsync, RunHillClimbingAlgorithmIterAsync, RunHillClimbingAlgorithmAsync };
  *  SafeGenerate();
  *  DrawMap();
  *  UnlockInterface(false);
  *  CurrentGeneration = 0;
  *  // Supposed that buton tabIndex coincedence with algorithms
  *  algorithm[(sender as Button).TabIndex]();
  * }*/
 private void SafeGenerate()
 {
     if (!isGenerated)
     {
         GenerateBtn.PerformClick();
     }
 }
Example #2
0
 private void GUI_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == (char)Keys.Enter)
     {
         GenerateBtn.PerformClick();
     }
 }
Example #3
0
 public void test()
 {
     GenerateBtn.Click();
     Cp1.Click();
     Cp2.Click();
     Cp3.Click();
     Cp4.Click();
     Cp5.Click();
     Cp6.Click();
     Cp7.Click();
     Cp8.Click();
     Cp9.Click();
     Cp10.Click();
     Thread.Sleep(800);
     Assert.IsTrue(Completed.Text.Contains("Good job"), "Not Completed");
     ClosePopUp.Click();
 }
Example #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            graphic             = Map.CreateGraphics();
            CityRedPen          = new Pen(color: Color.Red, width: 3);
            CityBluePen         = new Pen(color: Color.Blue, width: 3);
            WayBlackPen         = new Pen(color: Color.Black, width: 2);
            HomeWayGreenPen     = new Pen(color: Color.Green, width: 2);
            PossibleCityBluePen = new Pen(color: Color.Blue, width: 1);
            ChoosenCityBlackPen = new Pen(color: Color.Black, width: 1);

            run = true;
            currentGeneration  = 0;
            maxGeneration      = GenerationTrackBar.Value;
            DoubleNumberFormat = "#.###";
            Delay = DelayTrackBar.Value;

            lookAtCurrentCityIndex = 0;
            lookAtPrevCityIndex    = 0;

            GenerateBtn.PerformClick();
        }
Example #5
0
 public void test()
 {
     GenerateBtn.Click();
     for (int i = 2; i < 7; i++)
     {
         IWebElement         letter     = PropertiesCollection.driver.FindElement(By.XPath("/html/body/div[2]/div[1]/div[1]/div[2]/div/div[2]/div[2]/div[2]/table/tr[" + i + "]/td[1]"));
         IWebElement         ddl        = PropertiesCollection.driver.FindElement(By.XPath("/html/body/div[2]/div[1]/div[1]/div[2]/div/div[2]/div[2]/div[2]/table/tr[" + i + "]/td[2]/select"));
         SelectElement       selectList = new SelectElement(ddl);
         IList <IWebElement> options    = selectList.Options;
         for (int j = 1; j < 6; j++)
         {
             string optionText = options[j].Text.ToString();
             if (CheckLetter(letter.Text).Equals(optionText.Substring(0, 1)))
             {
                 SetMethods.SelectDropDown(ddl, optionText);
                 break;
             }
         }
     }
     SubmitBtn.Click();
     Thread.Sleep(800);
     Assert.IsTrue(Completed.Text.Contains("Good job"), "Not Completed");
     ClosePopUp.Click();
 }