public void RequestIntegration() { IntegrationRequest request = new IntegrationRequest(BuildCondition.IfModificationExists, "intervalTrigger", null); projectMock.Expect("NotifyPendingState"); projectMock.Expect("Integrate", request); projectMock.ExpectAndSignal("NotifySleepingState"); projectMock.SetupResult("MaxSourceControlRetries", 5); projectMock.SetupResult("SourceControlErrorHandling", ThoughtWorks.CruiseControl.Core.Sourcecontrol.Common.SourceControlErrorHandlingPolicy.ReportEveryFailure); integrationTriggerMock.ExpectAndSignal("IntegrationCompleted"); integrator.Start(); integrator.Request(request); integrationTriggerMock.WaitForSignal(); projectMock.WaitForSignal(); Assert.AreEqual(ProjectIntegratorState.Running, integrator.State); VerifyAll(); }
public void RequestIntegration() { IntegrationRequest request = new IntegrationRequest(BuildCondition.IfModificationExists, "intervalTrigger", null); LatchHelper projectLatchHelper = new LatchHelper(); projectMock.Setup(project => project.NotifyPendingState()).Verifiable(); projectMock.Setup(project => project.Integrate(request)).Verifiable(); projectMock.Setup(project => project.NotifySleepingState()).Callback(() => projectLatchHelper.SetLatch()).Verifiable(); projectMock.SetupGet(project => project.MaxSourceControlRetries).Returns(5); projectMock.SetupGet(project => project.SourceControlErrorHandling).Returns(ThoughtWorks.CruiseControl.Core.Sourcecontrol.Common.SourceControlErrorHandlingPolicy.ReportEveryFailure); LatchHelper integrationTriggerLatchHelper = new LatchHelper(); integrationTriggerMock.Setup(_trigger => _trigger.IntegrationCompleted()).Callback(() => integrationTriggerLatchHelper.SetLatch()).Verifiable(); integrator.Start(); integrator.Request(request); integrationTriggerLatchHelper.WaitForSignal(); projectLatchHelper.WaitForSignal(); Assert.AreEqual(ProjectIntegratorState.Running, integrator.State); VerifyAll(); }