public async Task FetchParticipantMatchesAsync_ShouldBeOkObjectResult() { // Arrange var challengeFaker = TestData.FakerFactory.CreateChallengeFaker(95632852, Game.LeagueOfLegends, ChallengeState.InProgress); var challenge = challengeFaker.FakeChallenge(); var participants = challenge.Participants; var participant = participants.First(); var matches = participant.Matches; TestMock.MatchQuery.Setup(matchQuery => matchQuery.FetchParticipantMatchesAsync(It.IsAny <ParticipantId>())).ReturnsAsync(matches).Verifiable(); var controller = new ParticipantMatchesController(TestMock.MatchQuery.Object, TestMapper); // Act var result = await controller.FetchParticipantMatchesAsync(new ParticipantId()); // Assert result.Should().BeOfType <OkObjectResult>(); TestMock.MatchQuery.Verify(matchQuery => matchQuery.FetchParticipantMatchesAsync(It.IsAny <ParticipantId>()), Times.Once); }
public async Task FetchParticipantMatchesAsync_ShouldBeNoContentResult() { // Arrange TestMock.MatchQuery.Setup(matchQuery => matchQuery.FetchParticipantMatchesAsync(It.IsAny <ParticipantId>())) .ReturnsAsync(new Collection <IMatch>()) .Verifiable(); var controller = new ParticipantMatchesController(TestMock.MatchQuery.Object, TestMapper); // Act var result = await controller.FetchParticipantMatchesAsync(new ParticipantId()); // Assert result.Should().BeOfType <NoContentResult>(); TestMock.MatchQuery.Verify(matchQuery => matchQuery.FetchParticipantMatchesAsync(It.IsAny <ParticipantId>()), Times.Once); }