예제 #1
0
        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));
        }