public void ClusterCoordinatorGetAllCoordinatorsForDisplayReturnsExpectedData() { // Arrange var coordinators = new EnumerableQuery <ClusterCoordinator>(new[] { new ClusterCoordinator { Id = _coordinatorId, PersonId = _person1.Id, ClusterId = _cluster1.Id, DisasterId = _disaster1.Id, Person = _person1, Cluster = _cluster1, Disaster = _disaster1 }, new ClusterCoordinator { Id = _notCoordinatorId, PersonId = _person2.Id, ClusterId = _cluster2.Id, DisasterId = _disaster1.Id, Person = _person2, Cluster = _cluster2, Disaster = _disaster1 } }); _dataService.Setup(x => x.ClusterCoordinators).Returns(coordinators); IList <Person> allPersonsForDisplay; // Act var clusterCoordinators = _clusterCoordinatorService.GetAllCoordinatorsForDisplay(_disaster1.Id, out allPersonsForDisplay).ToList(); // Assert Assert.IsNotNull(clusterCoordinators); Assert.IsNotNull(allPersonsForDisplay); Assert.AreEqual(2, clusterCoordinators.Count()); Assert.AreEqual(2, allPersonsForDisplay.Count()); const string errorMsg = "Could not find the coordinator with the ID of "; var firstCoordinator = clusterCoordinators.FirstOrDefault(cc => cc.Id == _coordinatorId); Assert.IsNotNull(firstCoordinator, errorMsg + _coordinatorId); var secondCoordinator = clusterCoordinators.FirstOrDefault(cc => cc.Id == _notCoordinatorId); Assert.IsNotNull(secondCoordinator, errorMsg + _notCoordinatorId); Assert.AreEqual(_person1.Id, firstCoordinator.PersonId); Assert.AreEqual(_person2.Id, secondCoordinator.PersonId); const string personErrorMsg = "Could not find person with the ID of "; var firstPerson = allPersonsForDisplay.FirstOrDefault(x => x.Id == _person1.Id); Assert.IsNotNull(firstPerson, personErrorMsg + _person1.Id); var secondPerson = allPersonsForDisplay.FirstOrDefault(x => x.Id == _person2.Id); Assert.IsNotNull(secondPerson, personErrorMsg + _person2.Id); }