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

            return(Console.Out);
        }
Esempio n. 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));
        }
Esempio n. 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));
        }