Example #1
0
        public bool RunFromEditor(GherkinLanguageService languageService, bool debug, TestRunnerTool?runnerTool = null)
        {
            if (dte.ActiveDocument == null || dte.ActiveDocument.ProjectItem == null)
            {
                return(false);
            }

            IGherkinFileScope fileScope;
            int currentLine     = GetCurrentLine(dte.ActiveDocument);
            var currentScenario = GetCurrentScenario(languageService, currentLine, out fileScope);

            if (currentScenario == null)
            {
                // run for the entire file
                return(RunFromProjectItem(dte.ActiveDocument.ProjectItem, debug, runnerTool));
            }

            //TODO: select the scenario outline example, if it was invoked from that line

            var testRunnerGateway = testRunnerGatewayProvider.GetTestRunnerGateway(runnerTool);

            if (testRunnerGateway == null)
            {
                return(false);
            }

            return(testRunnerGateway.RunScenario(dte.ActiveDocument.ProjectItem, currentScenario, fileScope, debug));
        }
Example #2
0
        public bool RunFromEditor(GherkinLanguageService languageService, bool debug)
        {
            if (dte.ActiveDocument == null || dte.ActiveDocument.ProjectItem == null)
            {
                return(false);
            }

            IGherkinFileScope fileScope;
            var currentScenario = GetCurrentScenario(languageService, dte.ActiveDocument, out fileScope);

            if (currentScenario == null)
            {
                // run for the entire file
                return(RunFromProjectItem(dte.ActiveDocument.ProjectItem, debug));
            }

            var testRunnerGateway = testRunnerGatewayProvider.GetTestRunnerGateway();

            if (testRunnerGateway == null)
            {
                return(false);
            }

            return(testRunnerGateway.RunScenario(dte.ActiveDocument.ProjectItem, currentScenario, fileScope, debug));
        }
Example #3
0
        public bool RunFromEditor(GherkinLanguageService languageService, bool debug, TestRunnerTool?runnerTool = null)
        {
            if (dte.ActiveDocument == null || dte.ActiveDocument.ProjectItem == null)
            {
                return(false);
            }

            IGherkinFileScope fileScope;
            int currentLine     = GetCurrentLine(dte.ActiveDocument);
            var currentScenario = GetCurrentScenario(languageService, currentLine, out fileScope);

            if (currentScenario == null)
            {
                // run for the entire file
                return(RunFromProjectItem(dte.ActiveDocument.ProjectItem, debug, runnerTool));
            }

            var currentScenatioOutline = currentScenario as IScenarioOutlineBlock;
            var examplesRow            = currentScenatioOutline == null ? null : currentScenatioOutline.GetExamplesRowFromPosition(currentLine);

            var testRunnerGateway = testRunnerGatewayProvider.GetTestRunnerGateway(runnerTool);

            if (testRunnerGateway == null)
            {
                return(false);
            }

            return(testRunnerGateway.RunScenario(dte.ActiveDocument.ProjectItem, currentScenario, examplesRow, fileScope, debug));
        }