IntegrationTesting.CommandRunner.RunFubu C# (CSharp) Method

RunFubu() public method

public RunFubu ( string commandLine ) : void
commandLine string
return void
        public void RunFubu(string commandLine)
        {
            Console.WriteLine("Running 'fubu {0}'", commandLine);

            var fileName = Path.Combine(_solutionDirectory, @"src\fubu\bin\debug\fubu.exe");
            var startup = new ProcessStartInfo(fileName, commandLine){
                CreateNoWindow = true,
                RedirectStandardError = true,
                RedirectStandardInput = true,
                RedirectStandardOutput = false,
                UseShellExecute = false,
                WorkingDirectory = _solutionDirectory
            };

            try
            {
                var process = Process.Start(startup);
                process.WaitForExit();

                if (process.ExitCode != 0)
                {
                    StoryTellerAssert.Fail("Command failed! -- " + commandLine);
                }
            }
            catch (StorytellerAssertionException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new ApplicationException("Trying to run " + fileName, e);
            }
        }

Usage Example

Esempio n. 1
0
        public void SetupEnvironment()
        {
            // TODO -- make this configurable?
            _runner = new CommandRunner();
            _runner.RunFubu("createvdir src/FubuTestApplication fubu-testing");

            _application = new ApplicationDriver();
        }
All Usage Examples Of IntegrationTesting.CommandRunner::RunFubu