Ejemplo n.º 1
0
        public void CommandRunnerWillHaveErrorOutput()
        {
            var command = new ConsoleCommand
                              {
                                  CommandFullLocation = "CommandLineUnitTester",
                                  Arguments = "We read you red 5"
                              };

            var runner = new ConsoleRunner(command);

            runner.Execute();

            Assert.That(runner.ErrorOutput.Contains("This is on the Error Stream"));
        }
Ejemplo n.º 2
0
        public void CommandLineRunnerWillTriggerEventWhenOutputRecieved()
        {
            var command = new ConsoleCommand
                              {
                                  CommandFullLocation = "CommandLineUnitTester"
                              };

            var runner = new ConsoleRunner(command);

            var dataCollection = new List<string>();

            runner.StandardOutputReceived += e => dataCollection.Add(e.Data);

            runner.Execute();

            Assert.That(dataCollection.Contains("This is echo base."));
        }
Ejemplo n.º 3
0
        public void CommandWillRunInGivenDirectory()
        {
            var command = new ConsoleCommand
                              {
                                  CommandFullLocation = "CommandLineUnitTester",
                                  Arguments = "We read you red 5",
                                  WorkingDirectory = @"C:\Program Files"
                              };

            var runner = new ConsoleRunner(command);

            runner.Execute();

            Assert.That(runner.Output.Contains(@"C:\Program Files"), Is.True);
        }
Ejemplo n.º 4
0
        public void CommandWillReturnOutputAsString()
        {
            var command = new ConsoleCommand
                              {
                                  CommandFullLocation = "CommandLineUnitTester"
                              };

            var runner = new ConsoleRunner(command);

            runner.Execute();

            Assert.That(runner.Output.Contains("This is echo base."), Is.True);
        }
Ejemplo n.º 5
0
        public void CommandWithArguments()
        {
            var command = new ConsoleCommand
                              {
                                  CommandFullLocation = "CommandLineUnitTester",
                                  Arguments = "We read you red 5",
                              };

            var runner = new ConsoleRunner(command);

            runner.Execute();

            Assert.That(runner.Output.Contains("Wereadyoured5"), Is.True);
        }