public void ForceBuild() { integrationTriggerMock.ExpectNoCall("Fire"); projectMock.Expect("Integrate", new HasForceBuildCondition()); projectMock.Expect("NotifyPendingState"); projectMock.ExpectAndSignal("NotifySleepingState"); projectMock.ExpectNoCall("Integrate", typeof(IntegrationRequest)); projectMock.SetupResult("MaxSourceControlRetries", 5); projectMock.SetupResult("SourceControlErrorHandling", ThoughtWorks.CruiseControl.Core.Sourcecontrol.Common.SourceControlErrorHandlingPolicy.ReportEveryFailure); integrator.Start(); integrationTriggerMock.ExpectAndSignal("IntegrationCompleted"); var parameters = new Dictionary <string, string>(); integrator.ForceBuild("BuildForcer", parameters); integrationTriggerMock.WaitForSignal(); projectMock.WaitForSignal(); VerifyAll(); }
public void ForceBuild() { LatchHelper projectLatchHelper = new LatchHelper(); projectMock.Setup(project => project.Integrate(It.Is <IntegrationRequest>(r => r.BuildCondition == BuildCondition.ForceBuild))).Verifiable(); projectMock.Setup(project => project.NotifyPendingState()).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); integrator.Start(); LatchHelper integrationTriggerLatchHelper = new LatchHelper(); integrationTriggerMock.Setup(_trigger => _trigger.IntegrationCompleted()).Callback(() => integrationTriggerLatchHelper.SetLatch()).Verifiable(); var parameters = new Dictionary <string, string>(); integrator.ForceBuild("BuildForcer", parameters); integrationTriggerLatchHelper.WaitForSignal(); projectLatchHelper.WaitForSignal(); VerifyAll(); projectMock.VerifyNoOtherCalls(); integrationTriggerMock.VerifyNoOtherCalls(); }