public TextWriter GetDoPrintStream(
            ParsedArguments p)
        {
            if (p.HasValue(CommandlineSwitchType.DoFile))
            {
                return(new StreamWriter(p.GetValue(CommandlineSwitchType.DoFile)));
            }

            return(Console.Out);
        }
示例#2
0
        public void ParseArgsShouldSetScriptFilesPathWhenGivenArgs()
        {
            var args = new[]
            {
                CommandlineSwitchType.ScriptFiles.GetSwitch()
                , SourcePath
            };

            ParsedArguments result = GetResultsForArgs(
                args);

            Assert.That(result.GetValue(CommandlineSwitchType.ScriptFiles), Is.EqualTo(SourcePath));
        }
示例#3
0
        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));
        }