public ReportCommentAsync ( int commentId, ReportReason reason ) : Task |
||
commentId | int | The comment id. |
reason | ReportReason | The reason why the comment is inappropriate. |
return | Task |
public async Task ReportCommentAsync_WithOAuth2TokenNull_ThrowsArgumentNullException() { var client = new ImgurClient("123", "1234"); var endpoint = new CommentEndpoint(client); var exception = await Record.ExceptionAsync( async () => await endpoint.ReportCommentAsync(539556821, ReportReason.Spam).ConfigureAwait(false)) .ConfigureAwait(false); Assert.NotNull(exception); Assert.IsType<ArgumentNullException>(exception); }
public async Task ReportCommentAsync_True() { var mockUrl = "https://api.imgur.com/3/comment/539556821/report"; var mockResponse = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(MockCommentEndpointResponses.ReportComment) }; var client = new ImgurClient("123", "1234", MockOAuth2Token); var endpoint = new CommentEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse))); var reported = await endpoint.ReportCommentAsync(539556821, ReportReason.MatureContentNotMarked).ConfigureAwait(false); Assert.True(reported); }