コード例 #1
0
        public void FireMustPass()
        {
            var webDriver = new Mock <IWebDriver>();
            var navigate  = new Mock <INavigation>();

            webDriver.Setup(x => x.Navigate()).Returns(navigate.Object);

            _driver.Setup(x => x.SeleniumWebDriver).Returns(webDriver.Object);

            var testCase1 = new Mock <ITestCase>();
            var testCase2 = new Mock <ITestCase>();
            var testStep  = new Mock <ITestStep>();

            testStep.Setup(x => x.Do).Returns(ActivityTypes.Navigate.Name);
            testStep.Setup(x => x.Argument).Returns("https://www.google.com");

            testCase1.Setup(x => x.Steps).Returns(new List <ITestStep> {
                testStep.Object
            });
            testCase2.Setup(x => x.Steps).Returns(new List <ITestStep> {
                testStep.Object
            });

            var testCases = new List <ITestCase> {
                testCase1.Object, testCase2.Object
            };

            var engine = new TestExecutionEngine(_driver.Object, _reporter.Object);

            engine.AddTestCases(testCases.ToArray());

            var result = engine.Fire();

            Assert.NotNull(result);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: dgvinay/Aura
        private static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var services = new ServiceCollection();

            var chromeDriverOptions = new AutomationDriverOptions
            {
            };
            var driver       = new DefaultChromeDriver(chromeDriverOptions);
            var reportEngine = new ExtentReportReporter(new ExtentReporterOptions
            {
            });
            var engine = new TestExecutionEngine(driver, reportEngine);

            engine.Fire();
        }