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(); }
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(); }