public override void LoadContent() { base.LoadContent(); btBackToMenu = new ConvertButton(TextureManager.GetTexture2D(ETexture2D.Button), 4, 1, 4, 30, "Main Menu", false, ScreenManager, this, new GameMenu(), new Vector2((800 - 206) / 2, 510)); lCButtonsPosition = new List <Rectangle>(); lLevelButton = new List <ConvertButton>(); for (int i = 0; i < 24; i++) { lCButtonsPosition.Add(new Rectangle(50 + (i % 6) * 125, 100 + (i / 6) * 100, 72, 50)); lLevelButton.Add(new ConvertButton(TextureManager.GetTexture2D(ETexture2D.LevelButton), 4, 1, 4, 30, string.Format("{0}", i + 1), false, ScreenManager, this, new MainGame(i), new Vector2(lCButtonsPosition[i].X, lCButtonsPosition[i].Y))); } }
public override void LoadContent() { base.LoadContent(); cRectPosition = new Vector2(cStartingButtonPosition.X - 32, 330); btStarting = new ConvertButton(TextureManager.GetTexture2D(ETexture2D.Button), 4, 1, 4, 30, "START", false, ScreenManager, this, new LevelMenu(), cStartingButtonPosition); btAbout = new ConvertButton(TextureManager.GetTexture2D(ETexture2D.Button), 4, 1, 4, 30, "ABOUT", false, ScreenManager, this, new AboutGame(), new Vector2(cStartingButtonPosition.X, cStartingButtonPosition.Y + 50)); btHelping = new ConvertButton(TextureManager.GetTexture2D(ETexture2D.Button), 4, 1, 4, 30, "HELP", false, ScreenManager, this, new Helping(), new Vector2(cStartingButtonPosition.X, cStartingButtonPosition.Y + 100)); btExiting = new ConvertButton(TextureManager.GetTexture2D(ETexture2D.Button), 4, 1, 4, 30, "EXIT", true, ScreenManager, this, new ExitGame(), new Vector2(cStartingButtonPosition.X, cStartingButtonPosition.Y + 150)); SongButton.cPos = new Vector2(650, 20); SoundButton.cPos = new Vector2(700, 20); }
public void Story1NoAmountEntered() { TestContext.WriteLine("No amount entered, convert button is clicked"); NavigateToCurrencyConverter(); if (IsElementFound(By.Id("westpac-iframe"), out IWebElement westpacFrame)) { //switch to the westpac-iframe driver.SwitchTo().Frame(westpacFrame); } if (IsElementFound(By.Id("convert"), out IWebElement ConvertButton)) { ConvertButton.Click(); String ExpectedText = "Please enter the amount you want to convert."; String ActualText = ""; if (IsElementFound(By.Id("errordiv"), out IWebElement ErrorText)) { ActualText = ErrorText.Text; } TestContext.WriteLine("ActualText is " + ActualText); Assert.AreEqual(ExpectedText, ActualText, "failed to find " + ExpectedText); } }
void ReleaseDesignerOutlets() { if (BlueValueLabel != null) { BlueValueLabel.Dispose(); BlueValueLabel = null; } if (ColourView != null) { ColourView.Dispose(); ColourView = null; } if (ConvertButton != null) { ConvertButton.Dispose(); ConvertButton = null; } if (GreenValueLabel != null) { GreenValueLabel.Dispose(); GreenValueLabel = null; } if (HexValueTextField != null) { HexValueTextField.Dispose(); HexValueTextField = null; } if (RedValueLabel != null) { RedValueLabel.Dispose(); RedValueLabel = null; } }
// User is able to convert 1 USD to NZD successfully public void Story2ConvertUSDtoNZD() { TestContext.WriteLine("Convert USD to NZD"); NavigateToCurrencyConverter(); if (IsElementFound(By.Id("westpac-iframe"), out IWebElement westpacFrame)) { //switch to the westpac-iframe driver.SwitchTo().Frame(westpacFrame); } if (IsElementFound(By.Id("ConvertFrom"), out IWebElement ConvertFromDropDown)) { ConvertFromDropDown.FindElement(By.XPath("//select[1]/option[2]")).Click(); } if (IsElementFound(By.Id("ConvertTo"), out IWebElement ConvertToDropDown)) { ConvertToDropDown.FindElement(By.XPath("//select[2]/option[1]")).Click(); } if (IsElementFound(By.Id("Amount"), out IWebElement AmountInput)) { AmountInput.SendKeys("1"); } if (IsElementFound(By.Id("convert"), out IWebElement ConvertButton)) { ConvertButton.Click(); String ActualText = ""; if (IsElementFound(By.Id("resultsdiv"), out IWebElement ResultText)) { ActualText = ResultText.Text; } String FailedMessage = "failed to convert USD to NZD"; Assert.IsTrue(ActualText.Contains("1 United States Dollar"), FailedMessage); Assert.IsTrue(ActualText.Contains("New Zealand Dollar"), FailedMessage); Assert.IsTrue(ActualText.Contains("Would you like to make another calculation"), FailedMessage); Assert.IsTrue(ActualText.Contains("notes you wish to exchange"), FailedMessage); } }
protected void ConvertButtonShow() { ConvertButton.Show(); ConvertButtonIcon.Show(); }
protected void ConvertButtonHide() { ConvertButton.Hide(); ConvertButtonIcon.Hide(); }