public Task AddWatchedQueue(string queueName)
        {
            var consoleProcessor = new ConsoleCommandProcessor(_environment, queueName);

            consoleProcessor.OnOutputLineReady += (ticket,line) =>
                _messageProducer.Publish(new CommandResultMessage
                {
                    RoutingKey = _environment.GetResultRoute(consoleProcessor.RouteKey),
                    Ticket = ticket,
                    CommandResult = line,
                }, _environment.Credential);

            var task = consoleProcessor.ListenForCommand();
            _tasks.Add(task);
            return task;
        }
        public void ConsoleCommandProcessorRunsACommand()
        {
            int lines = 0;
            var consoleCmd = new ConsoleCommandProcessor(
                new EnvironmentContext { Name = "prod", RootRouteKey = "admin" }, "listshare");

            consoleCmd.OnOutputLineReady += (ticket,line) =>
            {
                lines++;
            };

            consoleCmd.HandleMessage(new CommandMessage {
              ExecuteFile = @"c:\windows\system32\net.exe",
              Arguments = @"share",
              WorkingDirectory = @"c:\",
            });

            Assert.AreNotEqual(0, lines);
        }