From 76f1ff02d3592e13e9c9e4ba2bed11c0ab6f2ba0 Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Tue, 12 Dec 2023 02:06:29 +0900 Subject: [PATCH] =?utf8?q?TwitterApiConnection.DeleteAsync=E3=83=A1?= =?utf8?q?=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../Connection/TwitterApiConnectionTest.cs | 24 ---------------------- OpenTween/Connection/IApiConnectionLegacy.cs | 2 -- OpenTween/Connection/TwitterApiConnection.cs | 12 ----------- 3 files changed, 38 deletions(-) diff --git a/OpenTween.Tests/Connection/TwitterApiConnectionTest.cs b/OpenTween.Tests/Connection/TwitterApiConnectionTest.cs index b793548e..bfb4b5f9 100644 --- a/OpenTween.Tests/Connection/TwitterApiConnectionTest.cs +++ b/OpenTween.Tests/Connection/TwitterApiConnectionTest.cs @@ -482,30 +482,6 @@ namespace OpenTween.Connection } [Fact] - public async Task DeleteAsync_Test() - { - using var mockHandler = new HttpMessageHandlerMock(); - using var http = new HttpClient(mockHandler); - using var apiConnection = new TwitterApiConnection(); - apiConnection.Http = http; - - mockHandler.Enqueue(x => - { - Assert.Equal(HttpMethod.Delete, x.Method); - Assert.Equal("https://api.twitter.com/1.1/hoge/tetete.json", - x.RequestUri.AbsoluteUri); - - return new HttpResponseMessage(HttpStatusCode.NoContent); - }); - - var endpoint = new Uri("hoge/tetete.json", UriKind.Relative); - - await apiConnection.DeleteAsync(endpoint); - - Assert.Equal(0, mockHandler.QueueCount); - } - - [Fact] public async Task HandleTimeout_SuccessTest() { static async Task AsyncFunc(CancellationToken token) diff --git a/OpenTween/Connection/IApiConnectionLegacy.cs b/OpenTween/Connection/IApiConnectionLegacy.cs index b72dd507..7f364f6a 100644 --- a/OpenTween/Connection/IApiConnectionLegacy.cs +++ b/OpenTween/Connection/IApiConnectionLegacy.cs @@ -45,7 +45,5 @@ namespace OpenTween.Connection Task> PostLazyAsync(Uri uri, IDictionary? param, IDictionary? media); Task PostAsync(Uri uri, IDictionary? param, IDictionary? media); - - Task DeleteAsync(Uri uri); } } diff --git a/OpenTween/Connection/TwitterApiConnection.cs b/OpenTween/Connection/TwitterApiConnection.cs index 93db05aa..7c7e578f 100644 --- a/OpenTween/Connection/TwitterApiConnection.cs +++ b/OpenTween/Connection/TwitterApiConnection.cs @@ -351,18 +351,6 @@ namespace OpenTween.Connection } } - public async Task DeleteAsync(Uri uri) - { - var request = new DeleteRequest - { - RequestUri = uri, - }; - - await this.SendAsync(request) - .IgnoreResponse() - .ConfigureAwait(false); - } - public static async Task HandleTimeout(Func> func, TimeSpan timeout) { using var cts = new CancellationTokenSource(); -- 2.11.0