public void StartProcessWithArguments()
        {
            var log = Mock.Create<ILog>();
            Mock.Arrange(() => log.Info(Arg.AnyString));
            var processExecutionProvider = new ProcessExecutionProvider("cmd.exe", null, log);

            processExecutionProvider.ExecuteProcessWithAdditionalArguments("ipconfig");

            Assert.IsNotNull(processExecutionProvider.CurrentProcess);
            Assert.IsNotNull(processExecutionProvider.CurrentProcess.StartInfo);
            Assert.AreEqual("cmd.exe", processExecutionProvider.CurrentProcess.StartInfo.FileName);
            Assert.AreEqual("ipconfig", processExecutionProvider.CurrentProcess.StartInfo.Arguments);
            processExecutionProvider.CurrentProcess.Kill();
        }
        public void FinishCorrectly()
        {
            var log = Mock.Create<ILog>();
            Mock.Arrange(() => log.Info(Arg.AnyString));
            var processExecutionProvider = new ProcessExecutionProvider("cmd.exe", null, log);

            processExecutionProvider.ExecuteProcessWithAdditionalArguments("ipconfig");
           
            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(200);
                processExecutionProvider.CurrentProcess.Kill();
            });
            processExecutionProvider.CurrentProcessWaitForExit();
            Assert.IsTrue(processExecutionProvider.CurrentProcess.HasExited);
        }
        public void StartProcessWithDefaultConsoleArguments_WhenArgumentsNotSet()
        {
            var log = Mock.Create<ILog>();
            Mock.Arrange(() => log.Info(Arg.AnyString));
             
            var consoleArgumentsProvider = Mock.Create<IConsoleArgumentsProvider>();
            Mock.Arrange(() => consoleArgumentsProvider.ConsoleArguments).Returns("ipconfig");
            var processExecutionProvider = new ProcessExecutionProvider("cmd.exe", consoleArgumentsProvider, log);

            processExecutionProvider.ExecuteProcessWithAdditionalArguments();

            Assert.IsNotNull(processExecutionProvider.CurrentProcess);
            Assert.IsNotNull(processExecutionProvider.CurrentProcess.StartInfo);
            Assert.AreEqual("cmd.exe", processExecutionProvider.CurrentProcess.StartInfo.FileName);
            Assert.AreEqual("ipconfig", processExecutionProvider.CurrentProcess.StartInfo.Arguments);
            processExecutionProvider.CurrentProcess.Kill();
        }