how to test mediatr code example
Example: how to test mediatr
mockPeopleService = new Mock<IPeopleService>();
var people = ....;
var expectedResult = new GetCatsResponse()
{
Male = new List<string>() { "Garfield", "Jim", "Max", "Tom" },
Female = new List<string>() { "Garfield", "Simba", "Tabby" }
};
mockPeopleService.Setup(ps => ps.GetPeople()).Returns(people);
var handler = new GetCatsHandler(mockPeopleService.Object);
var actualResult = await GetActualResult(handler);
actualResult.Should().BeEquivalentTo(expectedResult, optons => optons.WithStrictOrdering());