Example #1
0
        public void Execute_DirCommand_ExecutesSuccessfully()
        {
            var dirCommand = new DirCommand();

            dirCommand.CommandExecution = CommandPromptCommand.CommandOptions.C;
            dirCommand.Paths.Add(".");
            dirCommand.Execute();
        }
Example #2
0
        public void StandardOutputWrittenGetsCorrectOutput()
        {
            var dirCommand = new DirCommand();

            dirCommand.CommandExecution = CommandPromptCommand.CommandOptions.C;
            dirCommand.Paths.Add(".");

            string actualOutput = string.Empty;

            dirCommand.StandardOutputWritten += (s, e) => actualOutput += (e.OutputLine + Environment.NewLine);

            dirCommand.Execute();
            Assert.AreEqual(dirCommand.StandardOutput, actualOutput);
        }