public void WhenInvokingWithWorkingDirShouldCallProcessAndRedirectStdOut() { var processWrapper = new ProcessWrapper(); var invoke = processWrapper.Invoke("cmd", "/c dir", "C:\\"); Assert.NotEmpty(invoke.Item2); }
public void WhenInvokingWithWorkingDirAndReturnZero() { var processWrapper = new ProcessWrapper(); var invoke = processWrapper.Invoke("cmd", "/c dir", "C:\\"); Assert.Equal(0, invoke.Item1); Assert.True(invoke.Item2.Count > 0); }
public void WhenInvokingWithWorkingDirAndCallbackShouldInvokeCallbackAndReturnZero() { int lineCount = 0; var processWrapper = new ProcessWrapper(); Assert.Equal(0, processWrapper.Invoke("cmd", "/c dir", "C:\\", (l) => { lineCount++; })); Assert.True(lineCount > 0); }
public void WhenInvokingAndCallbackShouldCallProcessAndRedirectStdOut() { string data = ""; var processWrapper = new ProcessWrapper(); var invoke = processWrapper.Invoke("cmd", "/c dir", (l) => { data += l; }); Assert.NotEmpty(data); }
public void WhenInvokingWithWorkingDirShouldReturn0() { var processWrapper = new ProcessWrapper(); Assert.Equal(0, processWrapper.Invoke("cmd", "/c dir", "C:\\").Item1); }
public void WhenInvokingWithWorkingDirAndCallbackShouldReturn0() { var processWrapper = new ProcessWrapper(); Assert.Equal(0, processWrapper.Invoke("cmd", "/c dir", "C:\\", null)); }