public void GetCruiseServerSnapshotWithProjectsAdded() { Project project2 = new Project(); project2.Name = TestQueueName2; Project project3 = new Project(); project3.Name = TestQueueName3; configuration.AddProject(project2); configuration.AddProject(project3); queueManager = new IntegrationQueueManager(new ProjectIntegratorListFactory(), configuration, (IProjectStateManager)stateManagerMock.MockInstance); CruiseServerSnapshot cruiseServerSnapshot = queueManager.GetCruiseServerSnapshot(); Assert.IsNotNull(cruiseServerSnapshot); bool found1 = false; bool found2 = false; bool found3 = false; foreach (ProjectStatus status in cruiseServerSnapshot.ProjectStatuses) { found1 |= (status.Name == TestQueueName); found2 |= (status.Name == TestQueueName2); found3 |= (status.Name == TestQueueName3); } if (!found1) Assert.Fail("Could not find " + TestQueueName); if (!found2) Assert.Fail("Could not find " + TestQueueName2); if (!found3) Assert.Fail("Could not find " + TestQueueName3); }
public void GetCruiseServerSnapshotWithNoProjects() { // Remove the project added in the test setup configuration.DeleteProject(TestQueueName); queueManager = new IntegrationQueueManager(new ProjectIntegratorListFactory(), configuration, (IProjectStateManager)stateManagerMock.MockInstance); CruiseServerSnapshot cruiseServerSnapshot = queueManager.GetCruiseServerSnapshot(); Assert.IsNotNull(cruiseServerSnapshot); Assert.AreEqual(0, cruiseServerSnapshot.ProjectStatuses.Length); Assert.IsNotNull(cruiseServerSnapshot.QueueSetSnapshot); Assert.AreEqual(0, cruiseServerSnapshot.QueueSetSnapshot.Queues.Count); }