Пример #1
0
        public async Task GetByPodcastIdAsync()
        {
            var apiConnection = Substitute.For <IApiConnection>();
            var client        = new CommentClient(apiConnection);

            await client.GetByPodcastIdAsync(1);

            await apiConnection.Received().ExecuteGetCollectionAsync <Comment>("comments?p_id=1");
        }
Пример #2
0
        public async Task GetByPodcastIdAsync_PodcastIdZero_Throw()
        {
            var apiConnection = Substitute.For <IApiConnection>();
            var client        = new CommentClient(apiConnection);

            await Assert.ThrowsExceptionAsync <ArgumentOutOfRangeException>(async() => await client.GetByPodcastIdAsync(0));

            await apiConnection.DidNotReceive().ExecuteGetCollectionAsync <Comment>(Arg.Any <string>());
        }