public GetCommentAsync ( int commentId ) : Task |
||
commentId | int | The comment id. |
Результат | Task |
public async Task GetCommentAsync_True() { var mockUrl = "https://api.imgur.com/3/comment/539556821"; var mockResponse = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(MockCommentEndpointResponses.GetComment) }; var client = new ImgurClient("123", "1234"); var endpoint = new CommentEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse))); var comment = await endpoint.GetCommentAsync(539556821).ConfigureAwait(false); Assert.NotNull(comment); Assert.Equal(539556821, comment.Id); Assert.Equal("n6gcXdY", comment.ImageId); Assert.Equal("It's called smirking. Lots of people do it.", comment.CommentText); Assert.Equal("WomanWiththeTattooedHands", comment.Author); Assert.Equal(499505, comment.AuthorId); Assert.Equal(false, comment.OnAlbum); Assert.Equal(null, comment.AlbumCover); Assert.Equal(379, comment.Ups); Assert.Equal(16, comment.Downs); Assert.Equal(363, comment.Points); Assert.Equal(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(1450526522), comment.DateTime); Assert.Equal(0, comment.ParentId); Assert.Equal("iphone", comment.Platform); Assert.Equal(false, comment.Deleted); Assert.Equal(VoteOption.Veto, comment.Vote); }