예제 #1
0
        public void WhenInvokingWithWorkingDirShouldCallProcessAndRedirectStdOut()
        {
            var processWrapper = new ProcessWrapper();
            var invoke         = processWrapper.Invoke("cmd", "/c dir", "C:\\");

            Assert.NotEmpty(invoke.Item2);
        }
예제 #2
0
        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);
        }
예제 #3
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);
        }
예제 #4
0
        public void WhenInvokingAndCallbackShouldCallProcessAndRedirectStdOut()
        {
            string data           = "";
            var    processWrapper = new ProcessWrapper();
            var    invoke         = processWrapper.Invoke("cmd", "/c dir", (l) => { data += l; });

            Assert.NotEmpty(data);
        }
예제 #5
0
        public void WhenInvokingWithWorkingDirShouldReturn0()
        {
            var processWrapper = new ProcessWrapper();

            Assert.Equal(0, processWrapper.Invoke("cmd", "/c dir", "C:\\").Item1);
        }
예제 #6
0
        public void WhenInvokingWithWorkingDirAndCallbackShouldReturn0()
        {
            var processWrapper = new ProcessWrapper();

            Assert.Equal(0, processWrapper.Invoke("cmd", "/c dir", "C:\\", null));
        }