Exemplo n.º 1
0
        public void MultiplyTest()
        {
            var blackBoxPage = new BlackBoxPage(driver);

            PageFactory.InitElements(driver, blackBoxPage);
            blackBoxPage.enterFirstText.SendKeys(Value1);
            Console.Write("Enter First Number [" + Value1 + "]");
            blackBoxPage.entersecondText.SendKeys(Value2);
            Console.Write("Enter second Number [" + Value2 + "]");
            int    totalResult = int.Parse(Value1) * int.Parse(Value2);
            String result      = Convert.ToString(totalResult);

            Thread.Sleep(TimeSpan.FromSeconds(4));
            blackBoxPage.clickMultiplyButton.Click();
            Console.Write("Click on [Multiply] button");
            Assert.IsTrue(blackBoxPage.verifyResult(result), "Result not matched");
            Console.Write("Verify Result passed");
        }
Exemplo n.º 2
0
        public void DivideTest()
        {
            var blackBoxPage = new BlackBoxPage(driver);

            PageFactory.InitElements(driver, blackBoxPage);
            blackBoxPage.enterFirstText.SendKeys(Value1);
            Console.Write("Enter First Number [" + Value1 + "]");
            blackBoxPage.entersecondText.SendKeys(Value2);
            Console.Write("Enter second Number [" + Value2 + "]");
            decimal totalResult = decimal.Parse(Value1) / decimal.Parse(Value2);
            decimal trun        = blackBoxPage.TruncateDecimal(totalResult, 2);
            String  result      = Convert.ToString(trun);

            blackBoxPage.clickDivideButton.Click();
            Console.Write("Click on [Division] button");
            Thread.Sleep(TimeSpan.FromSeconds(4));
            Assert.IsTrue(blackBoxPage.verifyResult(result), "Result not matched");
            Console.Write("Verify Result passed");
        }