public void Execute()
        {
            RetrieveFileDataForTestStep testFileLocation = index => @"c:\a\b";
            UploadReportFilesForTestStep uploader = (index, upload) => { };

            var runner = new Mock<IRunConsoleApplications>();
            {
                runner.Setup(r => r.Run(It.IsAny<string>(), It.IsAny<string[]>()))
                    .Callback(() => runner.Raise(r => r.OnConsoleOutput += null, new ProcessOutputEventArgs("foo")))
                    .Returns(0);
            }

            var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>());
            var sectionBuilder = new Mock<ITestSectionBuilder>();
            var diagnostics = new SystemDiagnostics((p, s) => { }, null);
            var executor = new ConsoleExecuteTestStepProcessor(
                testFileLocation,
                uploader,
                diagnostics,
                runner.Object,
                fileSystem,
                sectionBuilder.Object);

            var parameters = new List<TestStepParameter>
                {
                    new TestStepParameter
                        {
                            Key = "0",
                            Value = "Value",
                        },
                };

            var data = new ConsoleExecuteTestStep
            {
                pk_TestStepId = 1,
                Order = 2,
                TestStepParameters = parameters,
                ExecutableFilePath = @"c:\c\o\n\sole.exe"
            };

            var result = executor.Process(data, new List<InputParameter>());
            Assert.AreEqual(TestExecutionState.Passed, result);
        }
        public void ExecuteWithExceptionInConsoleRunner()
        {
            RetrieveFileDataForTestStep testFileLocation = index => @"c:\a\b";
            UploadReportFilesForTestStep uploader = (index, upload) => { };

            var runner = new Mock<IRunConsoleApplications>();
            {
                runner.Setup(r => r.Run(It.IsAny<string>(), It.IsAny<string[]>()))
                    .Throws<NotImplementedException>();
            }

            var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>());
            var sectionBuilder = new Mock<ITestSectionBuilder>();
            var diagnostics = new SystemDiagnostics((p, s) => { }, null);

            var executor = new ConsoleExecuteTestStepProcessor(
                testFileLocation,
                uploader,
                diagnostics,
                runner.Object,
                fileSystem,
                sectionBuilder.Object);

            var data = new ConsoleExecuteTestStep
            {
                pk_TestStepId = 1,
                Order = 2,
                ExecutableFilePath = @"c:\c\o\n\sole.exe"
            };

            var result = executor.Process(data, new List<InputParameter>());
            Assert.AreEqual(TestExecutionState.Failed, result);
        }