public void ShouldGetRegistrantsForProject() { const int projectId = 1; _authenticationRepository.Setup(m => m.Authenticate(It.IsAny <string>(), It.IsAny <string>())).Returns(new AuthToken { AccessToken = "totallylegittoken", ExpiresIn = 123 }); _ministryPlatformRest.Setup(m => m.UsingAuthenticationToken(token)).Returns(_ministryPlatformRest.Object); _ministryPlatformRest.Setup(m => m.Search <MpProjectRegistration>(It.IsAny <string>(), It.IsAny <string>(), null, false)).Returns(MockRegistrations()); var results = _fixture.GetRegistrantsForProject(projectId); Assert.IsInstanceOf(typeof(List <MpProjectRegistration>), results); Assert.AreEqual(2, results.Count); _ministryPlatformRest.VerifyAll(); }