public TextWriter GetDoPrintStream( ParsedArguments p) { if (p.HasValue(CommandlineSwitchType.DoFile)) { return(new StreamWriter(p.GetValue(CommandlineSwitchType.DoFile))); } return(Console.Out); }
public void ParseArgsShouldSetScriptFilesPathWhenGivenArgs() { var args = new[] { CommandlineSwitchType.ScriptFiles.GetSwitch() , SourcePath }; ParsedArguments result = GetResultsForArgs( args); Assert.That(result.GetValue(CommandlineSwitchType.ScriptFiles), Is.EqualTo(SourcePath)); }
public void ParseArgsShouldUndoScriptFileWhenGivenArgs() { ParsedArguments result = GetResultsForArgs( new[] { CommandlineSwitchType.ScriptFiles.GetSwitch() , SourcePath , CommandlineSwitchType.DoFile.GetSwitch() , DoScriptFile , CommandlineSwitchType.UndoFile.GetSwitch() , UndoScriptFile }); Assert.That(result.GetValue(CommandlineSwitchType.UndoFile), Is.EqualTo(UndoScriptFile)); }