public async Task GetPodcastByIdResponseAsync_Should_Return_ApiResponse_With_Podcast_By_Given_PodcastId() { PodcastClientMock podcastClientMock = PodcastClientMock.Create(); podcastClientMock.RestApiClientMock .Setup(client => client.GetApiResponseAsync <Podcast>( It.IsAny <string>(), It.IsAny <IList <KeyValuePair <string, string> > >(), It.IsAny <IDictionary <string, string> >())) .ReturnsAsync(() => new ApiResponse <Podcast>() { Model = new Podcast() }); ApiResponse <Podcast> apiResponse = await podcastClientMock.GetPodcastByIdResponseAsync(PodcastId); podcastClientMock.RestApiClientMock.Verify(client => client.GetApiResponseAsync <Podcast>( It.Is <string>(url => url == PodcastByIdUrl), It.Is <IList <KeyValuePair <string, string> > >(keyValues => keyValues == null), It.Is <IDictionary <string, string> >(keyValues => keyValues == null)), Times.Once); Assert.NotNull(apiResponse); Assert.NotNull(apiResponse.Model); }
public async Task GetPodcastByIdResponseAsync_Should_Throw_ArgumentException_If_PodcastId_Not_Greater_Than_Zero() { PodcastClientMock podcastClientMock = PodcastClientMock.Create(); await Assert.ThrowsAsync <ArgumentException>(() => podcastClientMock.GetPodcastByIdResponseAsync(-1)); }