public async Task GetPullRequestComments_ShouldCallCorrectUrlAndGetResult() { var responseJson = Utilities.LoadFile(Paths.GetStandardDataPath("GetPullRequestCommentsResponse.json")); var responseData = new NewtonsoftJsonSerializer().Deserialize <IteratorBasedPage <Comment> >(responseJson); var result = _restClient .Capture() .Args <string, int, QueryString, IEnumerable <Comment> >((s, url, limit, queryString) => s.GetAllPages <Comment>(url, limit, queryString), responseData.Values); var resultData = (await _sut.GetPullRequestComments("reponame", "owner", 1)).ToList(); Assert.AreEqual(1, result.CallCount); var args = result.Args[0]; Assert.Multiple(() => { Assert.AreEqual("repositories/owner/reponame/pullrequests/1/comments", args.arg1); Assert.AreEqual(50, args.arg2); Assert.IsNull(args.arg3); var secondComment = resultData[1]; Assert.AreEqual("<p>Response to hello!</p>", secondComment.Content.Html); Assert.AreEqual("Response to hello!", secondComment.Content.Raw); Assert.AreEqual("2017-05-14T17:09:00.032164+00:00", secondComment.CreatedOn); Assert.AreEqual(36823272, secondComment.Id); Assert.AreEqual(null, secondComment.Inline); Assert.AreEqual("2017-05-14T17:09:00.034473+00:00", secondComment.UpdatedOn); Assert.AreEqual("dispname", secondComment.User.DisplayName); Assert.AreEqual(36823271, secondComment.Parent.Id); }); }