public void ThrowsAnExceptionIfNoProfilesAreFound() { const string name = "Meowsa"; var request = new SearchForProfileRequest { Name = name }; _mockProfileRepo = CreateMockProfileRepository("ProfileNames"); var handler = new SearchForProfileRequestHandle(_mockProfileRepo.Object); var response = handler.Handle(request); Assert.That(response.Status, Is.EqualTo(ResponseCodes.NoResultsFound)); }
public void CanSearchForProfilesByName() { const string name = "Nancy Drew"; var request = new SearchForProfileRequest {Name = name}; _mockProfileRepo = CreateMockProfileRepository(name); var handler = new SearchForProfileRequestHandle(_mockProfileRepo.Object); var response = handler.Handle(request); Assert.That(response.Status, Is.EqualTo(ResponseCodes.Success)); Assert.That(response.Profiles.Count, Is.EqualTo(3)); }