ProcessRunner Start Method Delta Engine Documentation

Namespace: DeltaEngine.Core
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void Start()
Remarks

Tests: DeltaEngine.Tests.Core.ProcessRunnerTests
Examples

3 unit tests call DeltaEngine.Core.ProcessRunner.Start
[Test]
public void ChangingWorkingDirectory()
{
    var processRunner = new ProcessRunner("cmd.exe", "/c dir");
    processRunner.Start();
    var outputWithDefaultWorkingDirectory = processRunner.Output;
    processRunner.WorkingDirectory = @"C:\";
    processRunner.Start();
    var outputWithDefinedWorkingDirectory = processRunner.Output;
    Assert.AreNotEqual(outputWithDefaultWorkingDirectory, outputWithDefinedWorkingDirectory);
}
[Test]
public void StandardOutputEvent()
{
    var logger = new MockLogger();
    var processRunner = new ProcessRunner("cmd.exe", "/c dir");
    processRunner.StandardOutputEvent +=
        outputMessage => logger.Write(Logger.MessageType.Info, outputMessage);
    processRunner.Start();
    Assert.IsTrue(
        logger.LastMessage.Contains("Dir(s)") || logger.LastMessage.Contains("Verzeichnis(se)"),
        logger.LastMessage);
}
[Test]
public void TestTimeout()
{
    var processRunner = new ProcessRunner("cmd.exe", "/c dir", 1);
    Assert.Throws<ProcessRunner.StandardOutputHasTimedOutException>(processRunner.Start);
}
See Also