Ejemplo n.º 1
0
        private void Run(string pathToNBehaveConsole, string documentName, bool debug)
        {
            var    assemblyPath = visualStudioService.GetProjectAssemblyOutputPath();
            string filename     = "nbehave_" + DateTime.Now.Ticks.ToString(CultureInfo.InvariantCulture) + ".xml";
            var    xmlOutput    = Path.Combine(Path.GetTempPath(), filename);
            var    args         = FormatArguments(documentName, assemblyPath, xmlOutput, debug);

            var process = StartConsole(pathToNBehaveConsole, assemblyPath, args);
            var output  = new Task(() =>
            {
                try
                {
                    outputWindow.BringToFront();

                    while (!process.StandardOutput.EndOfStream)
                    {
                        outputWindow.WriteLine(process.StandardOutput.ReadLine());
                    }
                    CreateHtmlOutput(xmlOutput);
                }
                catch (Exception exception)
                {
                    outputWindow.WriteLine(exception.ToString());
                }
            });

            output.Start();

            if (debug)
            {
                visualStudioService.AttachDebugger(process.Id);
            }
        }
Ejemplo n.º 2
0
 private void ExecuteScenario(bool debug)
 {
     try
     {
         scenarioRunner.Run(debug);
     }
     catch (Exception exception)
     {
         outputWindow.WriteLine(exception.ToString());
     }
 }
Ejemplo n.º 3
0
 private void Output(string s)
 {
     _outputWindow.WriteLine(s);
 }