public void Abort() { integrationTriggerMock.SetupResultAndSignal("Fire", null); projectMock.ExpectNoCall("NotifyPendingState"); projectMock.ExpectNoCall("Integrate", typeof(IntegrationRequest)); projectMock.ExpectNoCall("NotifySleepingState"); integrationTriggerMock.ExpectNoCall("IntegrationCompleted"); integrator.Start(); integrationTriggerMock.WaitForSignal(); Assert.AreEqual(ProjectIntegratorState.Running, integrator.State); integrator.Abort(); integrator.WaitForExit(); Assert.AreEqual(ProjectIntegratorState.Stopped, integrator.State); VerifyAll(); }
public void Abort() { LatchHelper latchHelper = new LatchHelper(); integrationTriggerMock.Setup(_trigger => _trigger.Fire()).Callback(() => latchHelper.SetLatch()).Returns(() => null); integrator.Start(); latchHelper.WaitForSignal(); Assert.AreEqual(ProjectIntegratorState.Running, integrator.State); integrator.Abort(); integrator.WaitForExit(); Assert.AreEqual(ProjectIntegratorState.Stopped, integrator.State); projectMock.Verify(project => project.NotifyPendingState(), Times.Never); projectMock.Verify(project => project.Integrate(It.IsAny <IntegrationRequest>()), Times.Never); projectMock.Verify(project => project.NotifySleepingState(), Times.Never); integrationTriggerMock.Verify(_trigger => _trigger.IntegrationCompleted(), Times.Never); VerifyAll(); }