}
[Fact]
+ public async Task StatusesUnretweet_Test()
+ {
+ var mock = this.CreateApiConnectionMock<PostRequest>(r =>
+ {
+ Assert.Equal(new("statuses/unretweet.json", UriKind.Relative), r.RequestUri);
+ var expectedQuery = new Dictionary<string, string>
+ {
+ ["id"] = "100",
+ ["include_entities"] = "true",
+ ["include_ext_alt_text"] = "true",
+ ["tweet_mode"] = "extended",
+ };
+ Assert.Equal(expectedQuery, r.Query);
+ });
+
+ using var twitterApi = new TwitterApi();
+ twitterApi.ApiConnection = mock.Object;
+
+ await twitterApi.StatusesUnretweet(new("100"))
+ .IgnoreResponse();
+
+ mock.VerifyAll();
+ }
+
+ [Fact]
public async Task SearchTweets_Test()
{
var mock = this.CreateApiConnectionMock<GetRequest>(
return response.ReadAsLazyJson<TwitterStatus>();
}
+ public async Task<LazyJson<TwitterStatus>> StatusesUnretweet(TwitterStatusId statusId)
+ {
+ var request = new PostRequest
+ {
+ RequestUri = new("statuses/unretweet.json", UriKind.Relative),
+ Query = new Dictionary<string, string>
+ {
+ ["id"] = statusId.Id,
+ ["include_entities"] = "true",
+ ["include_ext_alt_text"] = "true",
+ ["tweet_mode"] = "extended",
+ },
+ };
+
+ using var response = await this.Connection.SendAsync(request)
+ .ConfigureAwait(false);
+
+ return response.ReadAsLazyJson<TwitterStatus>();
+ }
+
public async Task<TwitterSearchResult> SearchTweets(string query, string? lang = null, int? count = null, TwitterStatusId? maxId = null, TwitterStatusId? sinceId = null)
{
var param = new Dictionary<string, string>