예제 #1
0
        public void ShouldNotGetSourceIfAutoGetSourceFalse()
        {
            DynamicMock executor = new DynamicMock(typeof(ProcessExecutor));
            ClearCase clearCase = new ClearCase((ProcessExecutor) executor.MockInstance);
            clearCase.Executable = EXECUTABLE;
            clearCase.ViewPath = VIEWPATH;
            clearCase.AutoGetSource = false;

            executor.ExpectNoCall("Execute", typeof(ProcessInfo));
            clearCase.GetSource(new IntegrationResult());
            executor.Verify();
        }
예제 #2
0
        public void ShouldGetSourceIfAutoGetSourceTrue()
        {
            DynamicMock executor = new DynamicMock(typeof(ProcessExecutor));
            ClearCase clearCase = new ClearCase((ProcessExecutor) executor.MockInstance);
            clearCase.Executable = EXECUTABLE;
            clearCase.ViewPath = VIEWPATH;
            clearCase.AutoGetSource = true;

            ProcessInfo expectedProcessRequest = new ProcessInfo(EXECUTABLE, @"update -force -overwrite """ + VIEWPATH + @"""");
            expectedProcessRequest.TimeOut = Timeout.DefaultTimeout.Millis;

            executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest);
            clearCase.GetSource(new IntegrationResult());
            executor.Verify();
        }