public async Task GetPodcastStatisticOverallResponseAsync_Should_Return_ApiResponse_With_Statistic_By_Given_OverallStatisticFilter() { StatisticClientMock statisticClientMock = StatisticClientMock.Create(); statisticClientMock.RestApiClientMock .Setup(client => client.GetApiResponseAsync <Statistic>( It.IsAny <string>(), It.IsAny <IList <KeyValuePair <string, string> > >(), It.IsAny <IDictionary <string, string> >())) .ReturnsAsync(() => new ApiResponse <Statistic>() { Model = new Statistic() }); var queryParams = OverallStatisticFilter.ToQueryParams(); ApiResponse <Statistic> apiResponse = await statisticClientMock.GetPodcastStatisticOverallResponseAsync(PodcastId, OverallStatisticFilter); statisticClientMock.RestApiClientMock.Verify(client => client.GetApiResponseAsync <Statistic>( It.Is <string>(url => url == PodcastStatisticOverallUrl), It.Is <IList <KeyValuePair <string, string> > >(keyValues => keyValues.Any(pair => queryParams.Contains(pair))), It.Is <IDictionary <string, string> >(keyValues => keyValues == null)), Times.Once); Assert.NotNull(apiResponse); Assert.NotNull(apiResponse.Model); }
public async Task GetPodcastStatisticOverallResponseAsync_Should_Throw_ArgumentException_If_PodcastId_Not_Greater_Than_Zero() { StatisticClientMock statisticClientMock = StatisticClientMock.Create(); await Assert.ThrowsAsync <ArgumentException>(() => statisticClientMock.GetPodcastStatisticOverallResponseAsync(-1)); }