Ejemplo n.º 1
0
        public void EnsureCalculatorWorksCorrectly()
        {
            ChromeOptions options = new ChromeOptions();

            options.AddArgument("--log-level=3");
            using (IWebDriver driver = new ChromeDriver(options))
            {
                CalculatorPage calculatorPage = new CalculatorPage(driver);

                TestInvoker invoker = new TestInvoker(calculatorPage);

                Assert.AreEqual(invoker.GetResult("2+3"), "5");
                Assert.AreEqual(invoker.GetResult("183*3+2"), "551");
                Assert.AreEqual(invoker.GetResult("147/9"), "16.3333");
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            ChromeOptions options = new ChromeOptions();

            options.AddArgument("--log-level=3");
            using (IWebDriver driver = new ChromeDriver(options))
            {
                CalculatorPage calculatorPage = new CalculatorPage(driver);

                TestInvoker invoker = new TestInvoker(calculatorPage);

                Console.WriteLine("======");
                Console.WriteLine(invoker.GetResult("2+3"));
                Console.WriteLine(invoker.GetResultAndExpression("2+3"));
                Console.WriteLine(invoker.GetResult("183*3+2"));
                Console.WriteLine(invoker.GetResultAndExpression("183*3+2"));
                Console.WriteLine("======");

                Thread.Sleep(6000);
            }
        }