Answers for "how to test mediatr"

0

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());
Posted by: Guest on October-11-2020

Browse Popular Code Answers by Language