ImgurNet.ApiEndpoints.CommentEndpoint.GetCommentRepliesAsync C# (CSharp) Method

GetCommentRepliesAsync() public method

Get a comment with all of the replies for that comment
public GetCommentRepliesAsync ( System.Int64 commentId ) : Task>
commentId System.Int64 The Id of the comment
return Task>
		public async Task<ImgurResponse<Comment>> GetCommentRepliesAsync(Int64 commentId)
		{
			if (ImgurClient.Authentication == null)
				throw new InvalidAuthenticationException("Authentication can not be null. Set it in the main Imgur class.");

			if (!(ImgurClient.Authentication is OAuth2Authentication))
				throw new InvalidAuthenticationException("You need to use OAuth2Authentication to call this Endpoint.");

			return
				await
					Request.SubmitImgurRequestAsync<Comment>(Request.HttpMethod.Get, String.Format(CommentRepliesUrl, commentId),
						ImgurClient.Authentication);
		}

Usage Example

		public async Task TestGetCommentReplies()
		{
			var imgurClient = await AuthenticationHelpers.CreateOAuth2AuthenticatedImgurClient();
			var commentEndpoint = new CommentEndpoint(imgurClient);
			var comment = await commentEndpoint.GetCommentRepliesAsync(193421419);

			// Assert the Reponse
			Assert.IsNotNull(comment.Data);
			Assert.AreEqual(comment.Success, true);
			Assert.AreEqual(comment.Status, HttpStatusCode.OK);
		}