public void Should_ReturnsRecords_When_RecordsAvailable() { mockRepository.Setup(x => x.Get <ProjectAggregate>()) .Returns(fakeResult); mockUnitOfWork .Setup(x => x.CreateRepository()) .Returns(mockRepository.Object); var handler = new SearchProjectsHandler(mockUnitOfWork.Object); var result = handler.Handle(fakeQuery); result.Items.Should().HaveCount(2); }
public void Should_MapResultsCorrectly_When_RecordsAvailable() { mockRepository.Setup(x => x.Get <ProjectAggregate>()) .Returns(fakeResult); mockUnitOfWork .Setup(x => x.CreateRepository()) .Returns(mockRepository.Object); var handler = new SearchProjectsHandler(mockUnitOfWork.Object); var result = handler.Handle(fakeQuery); var item = result.Items[0]; result.Items[0].Id.Should().NotBeEmpty(); result.Items[0].Acronym.Should().Be("acronym"); result.Items[0].Analyst.Should().Be("last name, first name (acronym)"); result.Items[0].Status.Should().Be("InPreparation"); result.Items[0].TierLevel.Should().Be("Tier1"); }