public void OnRestartKillAllIntegratorsRefreshConfigAndStartupNewIntegrators() { integratorMock1.Setup(integrator => integrator.Start()).Verifiable(); integratorMock2.Setup(integrator => integrator.Start()).Verifiable(); server.Start(); integratorMock1.Setup(integrator => integrator.Stop(true)).Verifiable(); integratorMock1.Setup(integrator => integrator.WaitForExit()).Verifiable(); integratorMock2.Setup(integrator => integrator.Stop(true)).Verifiable(); integratorMock2.Setup(integrator => integrator.WaitForExit()).Verifiable(); configuration = new Configuration(); configuration.AddProject(project1); integratorList = new ProjectIntegratorList(); integratorList.Add(integrator1); configServiceMock.Setup(service => service.Load()).Returns(configuration).Verifiable(); projectIntegratorListFactoryMock.Setup(factory => factory.CreateProjectIntegrators(configuration.Projects, It.IsAny <IntegrationQueueSet>())) .Returns(integratorList).Verifiable(); server.Restart(); integratorMock1.Verify(integrator => integrator.Start(), Times.Exactly(2)); integratorMock2.Verify(integrator => integrator.Start(), Times.Exactly(1)); VerifyAll(); }
public void OnRestartKillAllIntegratorsRefreshConfigAndStartupNewIntegrators() { integratorMock1.Expect("Start"); integratorMock2.Expect("Start"); server.Start(); integratorMock1.Expect("Stop", true); integratorMock1.Expect("WaitForExit"); integratorMock2.Expect("Stop", true); integratorMock2.Expect("WaitForExit"); configuration = new Configuration(); configuration.AddProject(project1); integratorList = new ProjectIntegratorList(); integratorList.Add(integrator1); configServiceMock.ExpectAndReturn("Load", configuration); projectIntegratorListFactoryMock.ExpectAndReturn("CreateProjectIntegrators", integratorList, configuration.Projects, integrationQueue); integratorMock1.Expect("Start"); integratorMock2.ExpectNoCall("Start"); server.Restart(); VerifyAll(); }