public void TrimArgs() { var info = ProcessRunInfo.FromCommand("program arg1 arg2"); Assert.That(info.Filename, Is.EqualTo("program")); Assert.That(info.Arguments, Is.EqualTo("arg1 arg2")); }
public void SplitWithQuotes_NoArgs() { var info = ProcessRunInfo.FromCommand("\"program\""); Assert.That(info.Filename, Is.EqualTo("program")); Assert.That(info.Arguments, Is.Null); }
public void SplitNoQuotes_WhitespaceArgs() { var info = ProcessRunInfo.FromCommand("program "); Assert.That(info.Filename, Is.EqualTo("program")); Assert.That(info.Arguments, Is.Null); }
protected void RunCommandScript(string command) { var runInfo = ProcessRunInfo.FromCommand(command); runInfo.WorkingDirectory = ContentDirectory; var result = new ProcessRunner { Output = Output.Writer, }.Run(runInfo); if (result.ExitCode != 0) { throw new ApplicationException("Process terminated with a non-zero exit code!"); } }
public void IsEmpty_ThrowsException() { Assert.Throws <ArgumentNullException>(() => ProcessRunInfo.FromCommand(string.Empty)); }
public void IsNull_ThrowsException() { Assert.Throws <ArgumentNullException>(() => ProcessRunInfo.FromCommand(null)); }