public void CanCatchInvalidLabelConfiguration()
 {
     ClearCase clearCase = new ClearCase();
     const string invalidXml = "<sourcecontrol type=\"ClearCase\"><useLabel>NOT_A_BOOLEAN</useLabel></sourcecontrol>";
     Assert.That(delegate { NetReflector.Read(invalidXml, clearCase); },
                 Throws.TypeOf<NetReflectorConverterException>());
 }
        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();
        }
 protected void Setup()
 {
     clearCase = new ClearCase();
     NetReflector.Read(CLEARCASE_XML, clearCase);
 }
        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();
        }