OSDN Git Service

テストコード内で ConfigureAwait(false) を使用しない (xUnit1030)
authorKimura Youichi <kim.upsilon@bucyou.net>
Wed, 6 Dec 2023 18:07:59 +0000 (03:07 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Wed, 6 Dec 2023 18:36:02 +0000 (03:36 +0900)
https://xunit.net/xunit.analyzers/rules/xUnit1030

25 files changed:
OpenTween.Tests/Api/BitlyApiTest.cs
OpenTween.Tests/Api/GraphQL/CreateRetweetRequestTest.cs
OpenTween.Tests/Api/GraphQL/CreateTweetRequestTest.cs
OpenTween.Tests/Api/GraphQL/DeleteRetweetRequestTest.cs
OpenTween.Tests/Api/GraphQL/DeleteTweetRequestTest.cs
OpenTween.Tests/Api/GraphQL/ListLatestTweetsTimelineRequestTest.cs
OpenTween.Tests/Api/GraphQL/SearchTimelineRequestTest.cs
OpenTween.Tests/Api/GraphQL/TweetDetailRequestTest.cs
OpenTween.Tests/Api/GraphQL/UserByScreenNameRequestTest.cs
OpenTween.Tests/Api/GraphQL/UserTweetsAndRepliesRequestTest.cs
OpenTween.Tests/Api/ImgurApiTest.cs
OpenTween.Tests/Api/MicrosoftTranslatorApiTest.cs
OpenTween.Tests/Api/MobypictureApiTest.cs
OpenTween.Tests/Api/TwitterApiTest.cs
OpenTween.Tests/Api/TwitterV2/GetTimelineRequestTest.cs
OpenTween.Tests/Connection/LazyJsonTest.cs
OpenTween.Tests/Connection/OAuthHandlerTest.cs
OpenTween.Tests/Connection/TwitterApiConnectionTest.cs
OpenTween.Tests/MemoryImageTest.cs
OpenTween.Tests/ShortcutCommandTest.cs
OpenTween.Tests/Thumbnail/Services/FoursquareCheckinTest.cs
OpenTween.Tests/Thumbnail/Services/PbsTwimgComTest.cs
OpenTween.Tests/Thumbnail/Services/TinamiTest.cs
OpenTween.Tests/Thumbnail/Services/TumblrTest.cs
OpenTween.Tests/TweetThumbnailTest.cs

index b8c7f4a..73c295e 100644 (file)
@@ -60,8 +60,7 @@ namespace OpenTween.Api
 
             bitly.EndUserAccessToken = "hogehoge";
 
-            var result = await bitly.ShortenAsync(new Uri("http://www.example.com/"), "bit.ly")
-                .ConfigureAwait(false);
+            var result = await bitly.ShortenAsync(new Uri("http://www.example.com/"), "bit.ly");
             Assert.Equal("http://bit.ly/foo", result.OriginalString);
 
             Assert.Equal(0, mockHandler.QueueCount);
@@ -96,8 +95,7 @@ namespace OpenTween.Api
             bitly.EndUserLoginName = "username";
             bitly.EndUserApiKey = "hogehoge";
 
-            var result = await bitly.ShortenAsync(new Uri("http://www.example.com/"), "bit.ly")
-                .ConfigureAwait(false);
+            var result = await bitly.ShortenAsync(new Uri("http://www.example.com/"), "bit.ly");
             Assert.Equal("http://bit.ly/foo", result.OriginalString);
 
             Assert.Equal(0, mockHandler.QueueCount);
@@ -122,8 +120,7 @@ namespace OpenTween.Api
                     x.Headers.Authorization.Parameter
                 );
 
-                var body = await x.Content.ReadAsStringAsync()
-                    .ConfigureAwait(false);
+                var body = await x.Content.ReadAsStringAsync();
                 var query = HttpUtility.ParseQueryString(body);
 
                 Assert.Equal("password", query["grant_type"]);
@@ -136,8 +133,7 @@ namespace OpenTween.Api
                 };
             });
 
-            var result = await bitly.GetAccessTokenAsync("hogehoge", "tetete")
-                .ConfigureAwait(false);
+            var result = await bitly.GetAccessTokenAsync("hogehoge", "tetete");
             Assert.Equal("abcdefg", result);
 
             Assert.Equal(0, mockHandler.QueueCount);
@@ -158,8 +154,7 @@ namespace OpenTween.Api
                 };
             });
 
-            await Assert.ThrowsAsync<WebApiException>(() => bitly.GetAccessTokenAsync("hogehoge", "tetete"))
-                .ConfigureAwait(false);
+            await Assert.ThrowsAsync<WebApiException>(() => bitly.GetAccessTokenAsync("hogehoge", "tetete"));
 
             Assert.Equal(0, mockHandler.QueueCount);
         }
index 40f4db8..418d38f 100644 (file)
@@ -54,7 +54,7 @@ namespace OpenTween.Api.GraphQL
                 TweetId = new("12345"),
             };
 
-            var tweetId = await request.Send(mock.Object).ConfigureAwait(false);
+            var tweetId = await request.Send(mock.Object);
             Assert.Equal("1617128268548964354", tweetId.Id);
 
             mock.VerifyAll();
index 0565e47..ef5d8e8 100644 (file)
@@ -56,7 +56,7 @@ namespace OpenTween.Api.GraphQL
                 TweetText = "tetete",
             };
 
-            var status = await request.Send(mock.Object).ConfigureAwait(false);
+            var status = await request.Send(mock.Object);
             Assert.Equal("1680534146492317696", status.IdStr);
 
             mock.VerifyAll();
@@ -83,7 +83,7 @@ namespace OpenTween.Api.GraphQL
                 InReplyToTweetId = new("12345"),
                 ExcludeReplyUserIds = new[] { "11111", "22222" },
             };
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
             mock.VerifyAll();
         }
 
@@ -107,7 +107,7 @@ namespace OpenTween.Api.GraphQL
                 TweetText = "tetete",
                 MediaIds = new[] { "11111", "22222" },
             };
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
             mock.VerifyAll();
         }
     }
index 84f7664..fad2f63 100644 (file)
@@ -51,7 +51,7 @@ namespace OpenTween.Api.GraphQL
                 SourceTweetId = new("12345"),
             };
 
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
 
             mock.VerifyAll();
         }
index e4ebd0c..f8c1583 100644 (file)
@@ -51,7 +51,7 @@ namespace OpenTween.Api.GraphQL
                 TweetId = new("12345"),
             };
 
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
 
             mock.VerifyAll();
         }
index dc24d7c..cf623b5 100644 (file)
@@ -58,7 +58,7 @@ namespace OpenTween.Api.GraphQL
                 Count = 20,
             };
 
-            var response = await request.Send(mock.Object).ConfigureAwait(false);
+            var response = await request.Send(mock.Object);
             Assert.Single(response.Tweets);
             Assert.Equal("DAABCgABF0HfRMjAJxEKAAIWes8rE1oQAAgAAwAAAAEAAA", response.CursorTop);
             Assert.Equal("DAABCgABF0HfRMi__7QKAAIVAxUYmFWQAwgAAwAAAAIAAA", response.CursorBottom);
@@ -91,7 +91,7 @@ namespace OpenTween.Api.GraphQL
                 Cursor = "aaa",
             };
 
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
             mock.VerifyAll();
         }
     }
index 97459b1..f424861 100644 (file)
@@ -57,7 +57,7 @@ namespace OpenTween.Api.GraphQL
                 Count = 20,
             };
 
-            var response = await request.Send(mock.Object).ConfigureAwait(false);
+            var response = await request.Send(mock.Object);
             Assert.Single(response.Tweets);
             Assert.Equal("DAADDAABCgABFnlh4hraMAYKAAIOTm0DEhTAAQAIAAIAAAABCAADAAAAAAgABAAAAAAKAAUX8j3ezIAnEAoABhfyPd7Mf9jwAAA", response.CursorTop);
             Assert.Equal("DAADDAABCgABFnlh4hraMAYKAAIOTm0DEhTAAQAIAAIAAAACCAADAAAAAAgABAAAAAAKAAUX8j3ezIAnEAoABhfyPd7Mf9jwAAA", response.CursorBottom);
@@ -90,7 +90,7 @@ namespace OpenTween.Api.GraphQL
                 Cursor = "aaa",
             };
 
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
             mock.VerifyAll();
         }
     }
index 69b7c16..93e857f 100644 (file)
@@ -56,7 +56,7 @@ namespace OpenTween.Api.GraphQL
                 FocalTweetId = new("1619433164757413894"),
             };
 
-            var tweets = await request.Send(mock.Object).ConfigureAwait(false);
+            var tweets = await request.Send(mock.Object);
             Assert.Equal("1619433164757413894", tweets.Single().ToTwitterStatus().IdStr);
 
             mock.VerifyAll();
index 77786fe..075ee34 100644 (file)
@@ -55,7 +55,7 @@ namespace OpenTween.Api.GraphQL
                 ScreenName = "opentween",
             };
 
-            var user = await request.Send(mock.Object).ConfigureAwait(false);
+            var user = await request.Send(mock.Object);
             Assert.Equal("514241801", user.ToTwitterUser().IdStr);
 
             mock.VerifyAll();
index ea1c51e..b829b19 100644 (file)
@@ -57,7 +57,7 @@ namespace OpenTween.Api.GraphQL
                 Count = 20,
             };
 
-            var response = await request.Send(mock.Object).ConfigureAwait(false);
+            var response = await request.Send(mock.Object);
             Assert.Single(response.Tweets);
             Assert.Equal("DAABCgABF_tTnZvAJxEKAAIWes8rE1oQAAgAAwAAAAEAAA", response.CursorTop);
             Assert.Equal("DAABCgABF_tTnZu__-0KAAIWZa6KTRoAAwgAAwAAAAIAAA", response.CursorBottom);
@@ -90,7 +90,7 @@ namespace OpenTween.Api.GraphQL
                 Cursor = "aaa",
             };
 
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
             mock.VerifyAll();
         }
     }
index 0114f3c..b675a27 100644 (file)
@@ -86,8 +86,7 @@ namespace OpenTween.Api
 
             var imgurApi = new ImgurApi(ApiKey.Create("fake_api_key"), http);
             using var mediaItem = TestUtils.CreateDummyMediaItem();
-            var uploadedUrl = await imgurApi.UploadFileAsync(mediaItem, "てすと")
-                .ConfigureAwait(false);
+            var uploadedUrl = await imgurApi.UploadFileAsync(mediaItem, "てすと");
             Assert.Equal("https://i.imgur.com/aaaaaaa.png", uploadedUrl);
 
             Assert.Equal(0, mockHandler.QueueCount);
index 4587f02..cf0d720 100644 (file)
@@ -60,8 +60,7 @@ namespace OpenTween.Api
                 Assert.Equal("ja", query["to"]);
                 Assert.Equal("en", query["from"]);
 
-                var requestBody = await x.Content.ReadAsByteArrayAsync()
-                    .ConfigureAwait(false);
+                var requestBody = await x.Content.ReadAsByteArrayAsync();
 
                 using (var jsonReader = JsonReaderWriterFactory.CreateJsonReader(requestBody, XmlDictionaryReaderQuotas.Max))
                 {
@@ -88,8 +87,7 @@ namespace OpenTween.Api
                 };
             });
 
-            var result = await translateApi.TranslateAsync("hogehoge", langTo: "ja", langFrom: "en")
-                .ConfigureAwait(false);
+            var result = await translateApi.TranslateAsync("hogehoge", langTo: "ja", langFrom: "en");
             Assert.Equal("ほげほげ", result);
 
             mock.Verify(x => x.GetAccessTokenAsync(), Times.Once());
@@ -122,8 +120,7 @@ namespace OpenTween.Api
 
             var translateApi = mock.Object;
 
-            await translateApi.UpdateAccessTokenIfExpired()
-                .ConfigureAwait(false);
+            await translateApi.UpdateAccessTokenIfExpired();
 
             Assert.Equal("1234abcd", translateApi.AccessToken);
 
@@ -141,8 +138,7 @@ namespace OpenTween.Api
             translateApi.AccessToken = "1234abcd";
             translateApi.RefreshAccessTokenAt = DateTimeUtc.Now + TimeSpan.FromMinutes(3);
 
-            await translateApi.UpdateAccessTokenIfExpired()
-                .ConfigureAwait(false);
+            await translateApi.UpdateAccessTokenIfExpired();
 
             // RefreshAccessTokenAt の時刻を過ぎるまでは GetAccessTokenAsync は呼ばれない
             mock.Verify(x => x.GetAccessTokenAsync(), Times.Never());
@@ -159,8 +155,7 @@ namespace OpenTween.Api
             translateApi.AccessToken = "1234abcd";
             translateApi.RefreshAccessTokenAt = DateTimeUtc.Now - TimeSpan.FromMinutes(3);
 
-            await translateApi.UpdateAccessTokenIfExpired()
-                .ConfigureAwait(false);
+            await translateApi.UpdateAccessTokenIfExpired();
 
             Assert.Equal("5678efgh", translateApi.AccessToken);
 
@@ -190,8 +185,7 @@ namespace OpenTween.Api
                 };
             });
 
-            var result = await translateApi.GetAccessTokenAsync()
-                .ConfigureAwait(false);
+            var result = await translateApi.GetAccessTokenAsync();
 
             var expectedToken = (@"ACCESS_TOKEN", TimeSpan.FromMinutes(10));
             Assert.Equal(expectedToken, result);
index dc0899d..af05cb9 100644 (file)
@@ -58,8 +58,7 @@ namespace OpenTween.Api
 
             var mobypictureApi = new MobypictureApi(ApiKey.Create("fake_api_key"), http);
             using var mediaItem = TestUtils.CreateDummyMediaItem();
-            var uploadedUrl = await mobypictureApi.UploadFileAsync(mediaItem, "てすと")
-                .ConfigureAwait(false);
+            var uploadedUrl = await mobypictureApi.UploadFileAsync(mediaItem, "てすと");
             Assert.Equal("https://www.mobypicture.com/user/OpenTween/view/00000000", uploadedUrl);
 
             Assert.Equal(0, mockHandler.QueueCount);
index 27ad41e..49ca6b9 100644 (file)
@@ -104,8 +104,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.StatusesHomeTimeline(200, maxId: new("900"), sinceId: new("100"))
-                .ConfigureAwait(false);
+            await twitterApi.StatusesHomeTimeline(200, maxId: new("900"), sinceId: new("100"));
 
             mock.VerifyAll();
         }
@@ -133,8 +132,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.StatusesMentionsTimeline(200, maxId: new("900"), sinceId: new("100"))
-                .ConfigureAwait(false);
+            await twitterApi.StatusesMentionsTimeline(200, maxId: new("900"), sinceId: new("100"));
 
             mock.VerifyAll();
         }
@@ -164,8 +162,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.StatusesUserTimeline("twitterapi", count: 200, maxId: new("900"), sinceId: new("100"))
-                .ConfigureAwait(false);
+            await twitterApi.StatusesUserTimeline("twitterapi", count: 200, maxId: new("900"), sinceId: new("100"));
 
             mock.VerifyAll();
         }
@@ -191,8 +188,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.StatusesShow(statusId: new("100"))
-                .ConfigureAwait(false);
+            await twitterApi.StatusesShow(statusId: new("100"));
 
             mock.VerifyAll();
         }
@@ -219,8 +215,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.StatusesLookup(statusIds: new[] { "100", "200" })
-                .ConfigureAwait(false);
+            await twitterApi.StatusesLookup(statusIds: new[] { "100", "200" });
 
             mock.VerifyAll();
         }
@@ -258,8 +253,7 @@ namespace OpenTween.Api
                     excludeReplyUserIds: new[] { 100L, 200L },
                     attachmentUrl: "https://twitter.com/twitterapi/status/22634515958"
                 )
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -286,8 +280,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.StatusesUpdate("hogehoge", replyToId: null, mediaIds: null, excludeReplyUserIds: Array.Empty<long>())
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -307,8 +300,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.StatusesDestroy(statusId: new("100"))
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -334,8 +326,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.StatusesRetweet(new("100"))
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -366,8 +357,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.SearchTweets("from:twitterapi", "en", count: 200, maxId: new("900"), sinceId: new("100"))
-                .ConfigureAwait(false);
+            await twitterApi.SearchTweets("from:twitterapi", "en", count: 200, maxId: new("900"), sinceId: new("100"));
 
             mock.VerifyAll();
         }
@@ -392,8 +382,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.ListsOwnerships("twitterapi", cursor: -1L, count: 100)
-                .ConfigureAwait(false);
+            await twitterApi.ListsOwnerships("twitterapi", cursor: -1L, count: 100);
 
             mock.VerifyAll();
         }
@@ -418,8 +407,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.ListsSubscriptions("twitterapi", cursor: -1L, count: 100)
-                .ConfigureAwait(false);
+            await twitterApi.ListsSubscriptions("twitterapi", cursor: -1L, count: 100);
 
             mock.VerifyAll();
         }
@@ -445,8 +433,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.ListsMemberships("twitterapi", cursor: -1L, count: 100, filterToOwnedLists: true)
-                .ConfigureAwait(false);
+            await twitterApi.ListsMemberships("twitterapi", cursor: -1L, count: 100, filterToOwnedLists: true);
 
             mock.VerifyAll();
         }
@@ -471,8 +458,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.ListsCreate("hogehoge", description: "aaaa", @private: true)
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -498,8 +484,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.ListsUpdate(12345L, name: "hogehoge", description: "aaaa", @private: true)
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -522,8 +507,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.ListsDestroy(12345L)
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -553,8 +537,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.ListsStatuses(12345L, count: 200, maxId: new("900"), sinceId: new("100"), includeRTs: true)
-                .ConfigureAwait(false);
+            await twitterApi.ListsStatuses(12345L, count: 200, maxId: new("900"), sinceId: new("100"), includeRTs: true);
 
             mock.VerifyAll();
         }
@@ -581,8 +564,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.ListsMembers(12345L, cursor: -1)
-                .ConfigureAwait(false);
+            await twitterApi.ListsMembers(12345L, cursor: -1);
 
             mock.VerifyAll();
         }
@@ -609,8 +591,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.ListsMembersShow(12345L, "twitterapi")
-                .ConfigureAwait(false);
+            await twitterApi.ListsMembersShow(12345L, "twitterapi");
 
             mock.VerifyAll();
         }
@@ -637,8 +618,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.ListsMembersCreate(12345L, "twitterapi")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -665,8 +645,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.ListsMembersDestroy(12345L, "twitterapi")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -690,8 +669,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.DirectMessagesEventsList(count: 50, cursor: "12345abcdefg")
-                .ConfigureAwait(false);
+            await twitterApi.DirectMessagesEventsList(count: 50, cursor: "12345abcdefg");
 
             mock.VerifyAll();
         }
@@ -731,8 +709,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.DirectMessagesEventsNew(recipientId: 12345L, text: "hogehoge", mediaId: 67890L)
-                .ConfigureAwait(false);
+            await twitterApi.DirectMessagesEventsNew(recipientId: 12345L, text: "hogehoge", mediaId: 67890L);
 
             mock.VerifyAll();
         }
@@ -750,8 +727,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.DirectMessagesEventsDestroy(eventId: new("100"))
-                .ConfigureAwait(false);
+            await twitterApi.DirectMessagesEventsDestroy(eventId: new("100"));
 
             mock.VerifyAll();
         }
@@ -777,8 +753,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.UsersShow(screenName: "twitterapi")
-                .ConfigureAwait(false);
+            await twitterApi.UsersShow(screenName: "twitterapi");
 
             mock.VerifyAll();
         }
@@ -804,8 +779,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.UsersLookup(userIds: new[] { "11111", "22222" })
-                .ConfigureAwait(false);
+            await twitterApi.UsersLookup(userIds: new[] { "11111", "22222" });
 
             mock.VerifyAll();
         }
@@ -829,8 +803,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.UsersReportSpam(screenName: "twitterapi")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -858,8 +831,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.FavoritesList(200, maxId: 900L, sinceId: 100L)
-                .ConfigureAwait(false);
+            await twitterApi.FavoritesList(200, maxId: 900L, sinceId: 100L);
 
             mock.VerifyAll();
         }
@@ -883,8 +855,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.FavoritesCreate(statusId: new("100"))
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -908,8 +879,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.FavoritesDestroy(statusId: new("100"))
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -929,8 +899,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.FriendshipsShow(sourceScreenName: "twitter", targetScreenName: "twitterapi")
-                .ConfigureAwait(false);
+            await twitterApi.FriendshipsShow(sourceScreenName: "twitter", targetScreenName: "twitterapi");
 
             mock.VerifyAll();
         }
@@ -950,8 +919,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.FriendshipsCreate(screenName: "twitterapi")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -971,8 +939,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.FriendshipsDestroy(screenName: "twitterapi")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -992,8 +959,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.NoRetweetIds()
-                .ConfigureAwait(false);
+            await twitterApi.NoRetweetIds();
 
             mock.VerifyAll();
         }
@@ -1013,8 +979,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.FollowersIds(cursor: -1L)
-                .ConfigureAwait(false);
+            await twitterApi.FollowersIds(cursor: -1L);
 
             mock.VerifyAll();
         }
@@ -1034,8 +999,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.MutesUsersIds(cursor: -1L)
-                .ConfigureAwait(false);
+            await twitterApi.MutesUsersIds(cursor: -1L);
 
             mock.VerifyAll();
         }
@@ -1055,8 +1019,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.BlocksIds(cursor: -1L)
-                .ConfigureAwait(false);
+            await twitterApi.BlocksIds(cursor: -1L);
 
             mock.VerifyAll();
         }
@@ -1080,8 +1043,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.BlocksCreate(screenName: "twitterapi")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -1105,8 +1067,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.BlocksDestroy(screenName: "twitterapi")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -1135,8 +1096,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.AccountVerifyCredentials()
-                .ConfigureAwait(false);
+            await twitterApi.AccountVerifyCredentials();
 
             Assert.Equal(100L, twitterApi.CurrentUserId);
             Assert.Equal("opentween", twitterApi.CurrentScreenName);
@@ -1168,8 +1128,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.AccountUpdateProfile(name: "Name", url: "http://example.com/", location: "Location", description: "<script>alert(1)</script>")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -1197,8 +1156,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.AccountUpdateProfileImage(media)
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -1218,8 +1176,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.ApplicationRateLimitStatus()
-                .ConfigureAwait(false);
+            await twitterApi.ApplicationRateLimitStatus();
 
             mock.VerifyAll();
         }
@@ -1239,8 +1196,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.Configuration()
-                .ConfigureAwait(false);
+            await twitterApi.Configuration();
 
             mock.VerifyAll();
         }
@@ -1266,8 +1222,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.MediaUploadInit(totalBytes: 123456L, mediaType: "image/png", mediaCategory: "dm_image")
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -1294,8 +1249,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.MediaUploadAppend(mediaId: 11111L, segmentIndex: 1, media: media)
-                .ConfigureAwait(false);
+            await twitterApi.MediaUploadAppend(mediaId: 11111L, segmentIndex: 1, media: media);
 
             mock.VerifyAll();
         }
@@ -1319,8 +1273,7 @@ namespace OpenTween.Api
             twitterApi.ApiConnection = mock.Object;
 
             await twitterApi.MediaUploadFinalize(mediaId: 11111L)
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             mock.VerifyAll();
         }
@@ -1344,8 +1297,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.MediaUploadStatus(mediaId: 11111L)
-                .ConfigureAwait(false);
+            await twitterApi.MediaUploadStatus(mediaId: 11111L);
 
             mock.VerifyAll();
         }
@@ -1364,8 +1316,7 @@ namespace OpenTween.Api
             using var twitterApi = new TwitterApi(ApiKey.Create("fake_consumer_key"), ApiKey.Create("fake_consumer_secret"));
             twitterApi.ApiConnection = mock.Object;
 
-            await twitterApi.MediaMetadataCreate(mediaId: 12345L, altText: "hogehoge")
-                .ConfigureAwait(false);
+            await twitterApi.MediaMetadataCreate(mediaId: 12345L, altText: "hogehoge");
 
             mock.VerifyAll();
         }
index bf99006..fcf5adf 100644 (file)
@@ -57,7 +57,7 @@ namespace OpenTween.Api.TwitterV2
                 UntilId = new("900"),
             };
 
-            await request.Send(mock.Object).ConfigureAwait(false);
+            await request.Send(mock.Object);
 
             mock.VerifyAll();
         }
index 0c003ac..6ebf632 100644 (file)
@@ -47,8 +47,7 @@ namespace OpenTween.Connection
             // この時点ではまだレスポンスボディは読まれない
             Assert.Equal(0, bodyStream.Position);
 
-            var result = await lazyJson.LoadJsonAsync()
-                .ConfigureAwait(false);
+            var result = await lazyJson.LoadJsonAsync();
 
             Assert.Equal("hogehoge", result);
         }
@@ -66,8 +65,9 @@ namespace OpenTween.Connection
             // この時点ではまだレスポンスボディは読まれない
             Assert.Equal(0, bodyStream.Position);
 
-            var exception = await Assert.ThrowsAnyAsync<WebApiException>(() => lazyJson.LoadJsonAsync())
-                .ConfigureAwait(false);
+            var exception = await Assert.ThrowsAnyAsync<WebApiException>(
+                () => lazyJson.LoadJsonAsync()
+            );
 
             Assert.IsType<SerializationException>(exception.InnerException);
         }
@@ -86,8 +86,7 @@ namespace OpenTween.Connection
 
             // レスポンスボディを読まずに破棄
             await Task.FromResult(lazyJson)
-                .IgnoreResponse()
-                .ConfigureAwait(false);
+                .IgnoreResponse();
 
             Assert.True(bodyStream.IsDisposed);
         }
index 51dd44d..db59819 100644 (file)
@@ -36,8 +36,7 @@ namespace OpenTween.Connection
         {
             var requestUri = new Uri("http://example.com/api?aaa=1&bbb=2");
 
-            var actual = await OAuthHandler.GetParameters(requestUri, content: null)
-                .ConfigureAwait(false);
+            var actual = await OAuthHandler.GetParameters(requestUri, content: null);
             var expected = new[]
             {
                 new KeyValuePair<string, string>("aaa", "1"),
@@ -58,8 +57,7 @@ namespace OpenTween.Connection
             };
 
             using var content = new FormUrlEncodedContent(formParams);
-            var actual = await OAuthHandler.GetParameters(requestUri, content)
-                .ConfigureAwait(false);
+            var actual = await OAuthHandler.GetParameters(requestUri, content);
 
             var expected = new[]
             {
@@ -81,8 +79,7 @@ namespace OpenTween.Connection
             content.Add(paramA, "aaa");
             content.Add(paramB, "bbb");
 
-            var actual = await OAuthHandler.GetParameters(requestUri, content)
-                .ConfigureAwait(false);
+            var actual = await OAuthHandler.GetParameters(requestUri, content);
 
             // multipart/form-data のリクエストではパラメータを署名対象にしない
             Assert.Empty(actual);
index e975481..929f45e 100644 (file)
@@ -83,8 +83,7 @@ namespace OpenTween.Connection
                 ["bbbb"] = "2222",
             };
 
-            var result = await apiConnection.GetAsync<string>(endpoint, param, endpointName: "/hoge/tetete")
-                .ConfigureAwait(false);
+            var result = await apiConnection.GetAsync<string>(endpoint, param, endpointName: "/hoge/tetete");
             Assert.Equal("hogehoge", result);
 
             Assert.Equal(0, mockHandler.QueueCount);
@@ -122,8 +121,7 @@ namespace OpenTween.Connection
                 ["bbbb"] = "2222",
             };
 
-            await apiConnection.GetAsync<string>(endpoint, param, endpointName: "/hoge/tetete")
-                .ConfigureAwait(false);
+            await apiConnection.GetAsync<string>(endpoint, param, endpointName: "/hoge/tetete");
 
             Assert.Equal(0, mockHandler.QueueCount);
         }
@@ -160,8 +158,7 @@ namespace OpenTween.Connection
 
             var endpoint = new Uri("hoge/tetete.json", UriKind.Relative);
 
-            await apiConnection.GetAsync<string>(endpoint, null, endpointName: "/hoge/tetete")
-                .ConfigureAwait(false);
+            await apiConnection.GetAsync<string>(endpoint, null, endpointName: "/hoge/tetete");
 
             Assert.Equal(TwitterApiAccessLevel.ReadWriteAndDirectMessage, apiStatus.AccessLevel);
             Assert.Equal(new ApiLimit(150, 100, new DateTimeUtc(2013, 1, 1, 0, 0, 0)), apiStatus.AccessLimit["/hoge/tetete"]);
@@ -187,8 +184,9 @@ namespace OpenTween.Connection
 
             var endpoint = new Uri("hoge/tetete.json", UriKind.Relative);
 
-            var exception = await Assert.ThrowsAsync<TwitterApiException>(() => apiConnection.GetAsync<string>(endpoint, null, endpointName: "/hoge/tetete"))
-                .ConfigureAwait(false);
+            var exception = await Assert.ThrowsAsync<TwitterApiException>(
+                () => apiConnection.GetAsync<string>(endpoint, null, endpointName: "/hoge/tetete")
+            );
 
             // エラーレスポンスの読み込みに失敗した場合はステータスコードをそのままメッセージに使用する
             Assert.Equal("BadGateway", exception.Message);
@@ -215,8 +213,9 @@ namespace OpenTween.Connection
 
             var endpoint = new Uri("hoge/tetete.json", UriKind.Relative);
 
-            var exception = await Assert.ThrowsAsync<TwitterApiException>(() => apiConnection.GetAsync<string>(endpoint, null, endpointName: "/hoge/tetete"))
-                .ConfigureAwait(false);
+            var exception = await Assert.ThrowsAsync<TwitterApiException>(
+                () => apiConnection.GetAsync<string>(endpoint, null, endpointName: "/hoge/tetete")
+            );
 
             // エラーレスポンスの JSON に含まれるエラーコードに基づいてメッセージを出力する
             Assert.Equal("DuplicateStatus", exception.Message);
@@ -260,13 +259,12 @@ namespace OpenTween.Connection
                 ["bbbb"] = "2222",
             };
 
-            var stream = await apiConnection.GetStreamAsync(endpoint, param)
-                .ConfigureAwait(false);
+            var stream = await apiConnection.GetStreamAsync(endpoint, param);
 
             using (var memoryStream = new MemoryStream())
             {
                 // 内容の比較のために MemoryStream にコピー
-                await stream.CopyToAsync(memoryStream).ConfigureAwait(false);
+                await stream.CopyToAsync(memoryStream);
 
                 Assert.Equal(image.Stream.ToArray(), memoryStream.ToArray());
             }
@@ -288,8 +286,7 @@ namespace OpenTween.Connection
                 Assert.Equal("https://api.twitter.com/1.1/hoge/tetete.json",
                     x.RequestUri.AbsoluteUri);
 
-                var body = await x.Content.ReadAsStringAsync()
-                    .ConfigureAwait(false);
+                var body = await x.Content.ReadAsStringAsync();
                 var query = HttpUtility.ParseQueryString(body);
 
                 Assert.Equal("1111", query["aaaa"]);
@@ -308,10 +305,9 @@ namespace OpenTween.Connection
                 ["bbbb"] = "2222",
             };
 
-            var result = await apiConnection.PostLazyAsync<string>(endpoint, param)
-                .ConfigureAwait(false);
+            var result = await apiConnection.PostLazyAsync<string>(endpoint, param);
 
-            Assert.Equal("hogehoge", await result.LoadJsonAsync().ConfigureAwait(false));
+            Assert.Equal("hogehoge", await result.LoadJsonAsync());
 
             Assert.Equal(0, mockHandler.QueueCount);
         }
@@ -360,7 +356,7 @@ namespace OpenTween.Connection
                     .Concat(image.Stream.ToArray())
                     .Concat(Encoding.UTF8.GetBytes($"\r\n--{boundary}--\r\n"));
 
-                Assert.Equal(expected, await x.Content.ReadAsByteArrayAsync().ConfigureAwait(false));
+                Assert.Equal(expected, await x.Content.ReadAsByteArrayAsync());
 
                 return new HttpResponseMessage(HttpStatusCode.OK)
                 {
@@ -379,10 +375,9 @@ namespace OpenTween.Connection
                 ["media1"] = media,
             };
 
-            var result = await apiConnection.PostLazyAsync<string>(endpoint, param, mediaParam)
-                .ConfigureAwait(false);
+            var result = await apiConnection.PostLazyAsync<string>(endpoint, param, mediaParam);
 
-            Assert.Equal("hogehoge", await result.LoadJsonAsync().ConfigureAwait(false));
+            Assert.Equal("hogehoge", await result.LoadJsonAsync());
 
             Assert.Equal(0, mockHandler.QueueCount);
         }
@@ -415,7 +410,7 @@ namespace OpenTween.Connection
 
                 var expected = Encoding.UTF8.GetBytes(expectedText);
 
-                Assert.Equal(expected, await x.Content.ReadAsByteArrayAsync().ConfigureAwait(false));
+                Assert.Equal(expected, await x.Content.ReadAsByteArrayAsync());
 
                 return new HttpResponseMessage(HttpStatusCode.OK)
                 {
@@ -425,10 +420,9 @@ namespace OpenTween.Connection
 
             var endpoint = new Uri("hoge/tetete.json", UriKind.Relative);
 
-            var result = await apiConnection.PostLazyAsync<string>(endpoint, param: null, media: null)
-                .ConfigureAwait(false);
+            var result = await apiConnection.PostLazyAsync<string>(endpoint, param: null, media: null);
 
-            Assert.Equal("hogehoge", await result.LoadJsonAsync().ConfigureAwait(false));
+            Assert.Equal("hogehoge", await result.LoadJsonAsync());
 
             Assert.Equal(0, mockHandler.QueueCount);
         }
@@ -449,8 +443,7 @@ namespace OpenTween.Connection
 
                 Assert.Equal("application/json; charset=utf-8", x.Content.Headers.ContentType.ToString());
 
-                var body = await x.Content.ReadAsStringAsync()
-                    .ConfigureAwait(false);
+                var body = await x.Content.ReadAsStringAsync();
 
                 Assert.Equal("""{"aaaa": 1111}""", body);
 
@@ -462,8 +455,7 @@ namespace OpenTween.Connection
 
             var endpoint = new Uri("hoge/tetete.json", UriKind.Relative);
 
-            var response = await apiConnection.PostJsonAsync(endpoint, """{"aaaa": 1111}""")
-                .ConfigureAwait(false);
+            var response = await apiConnection.PostJsonAsync(endpoint, """{"aaaa": 1111}""");
 
             Assert.Equal(@"{""ok"":true}", response);
             Assert.Equal(0, mockHandler.QueueCount);
@@ -485,8 +477,7 @@ namespace OpenTween.Connection
 
                 Assert.Equal("application/json; charset=utf-8", x.Content.Headers.ContentType.ToString());
 
-                var body = await x.Content.ReadAsStringAsync()
-                    .ConfigureAwait(false);
+                var body = await x.Content.ReadAsStringAsync();
 
                 Assert.Equal("""{"aaaa": 1111}""", body);
 
@@ -497,12 +488,8 @@ namespace OpenTween.Connection
             });
 
             var endpoint = new Uri("hoge/tetete.json", UriKind.Relative);
-
-            var response = await apiConnection.PostJsonAsync<string>(endpoint, """{"aaaa": 1111}""")
-                .ConfigureAwait(false);
-
-            var result = await response.LoadJsonAsync()
-                .ConfigureAwait(false);
+            var response = await apiConnection.PostJsonAsync<string>(endpoint, """{"aaaa": 1111}""");
+            var result = await response.LoadJsonAsync();
 
             Assert.Equal("hogehoge", result);
 
@@ -528,8 +515,7 @@ namespace OpenTween.Connection
 
             var endpoint = new Uri("hoge/tetete.json", UriKind.Relative);
 
-            await apiConnection.DeleteAsync(endpoint)
-                .ConfigureAwait(false);
+            await apiConnection.DeleteAsync(endpoint);
 
             Assert.Equal(0, mockHandler.QueueCount);
         }
index b038455..bf29a2f 100644 (file)
@@ -37,7 +37,7 @@ namespace OpenTween
         public async Task ImageFormat_GifTest()
         {
             using var imgStream = File.OpenRead("Resources/re.gif");
-            using var image = await MemoryImage.CopyFromStreamAsync(imgStream).ConfigureAwait(false);
+            using var image = await MemoryImage.CopyFromStreamAsync(imgStream);
             Assert.Equal(ImageFormat.Gif, image.ImageFormat);
             Assert.Equal(".gif", image.ImageFormatExt);
         }
@@ -58,8 +58,7 @@ namespace OpenTween
         {
             using var stream = File.OpenRead("Resources/re.gif");
             using var memstream = new MemoryStream();
-            await stream.CopyToAsync(memstream)
-                .ConfigureAwait(false);
+            await stream.CopyToAsync(memstream);
 
             stream.Seek(0, SeekOrigin.Begin);
 
@@ -72,13 +71,11 @@ namespace OpenTween
         {
             using var stream = File.OpenRead("Resources/re.gif");
             using var memstream = new MemoryStream();
-            await stream.CopyToAsync(memstream)
-                .ConfigureAwait(false);
+            await stream.CopyToAsync(memstream);
 
             stream.Seek(0, SeekOrigin.Begin);
 
-            using var image = await MemoryImage.CopyFromStreamAsync(stream)
-                .ConfigureAwait(false);
+            using var image = await MemoryImage.CopyFromStreamAsync(stream);
             Assert.Equal(memstream.ToArray(), image.Stream.ToArray());
         }
 
@@ -87,8 +84,7 @@ namespace OpenTween
         {
             using var stream = File.OpenRead("Resources/re.gif");
             using var memstream = new MemoryStream();
-            await stream.CopyToAsync(memstream)
-                .ConfigureAwait(false);
+            await stream.CopyToAsync(memstream);
             var imageBytes = memstream.ToArray();
 
             using var image = MemoryImage.CopyFromBytes(imageBytes);
@@ -121,10 +117,10 @@ namespace OpenTween
         public async Task Equals_Test()
         {
             using var imgStream1 = File.OpenRead("Resources/re.gif");
-            using var image1 = await MemoryImage.CopyFromStreamAsync(imgStream1).ConfigureAwait(false);
+            using var image1 = await MemoryImage.CopyFromStreamAsync(imgStream1);
 
             using var imgStream2 = File.OpenRead("Resources/re.gif");
-            using var image2 = await MemoryImage.CopyFromStreamAsync(imgStream2).ConfigureAwait(false);
+            using var image2 = await MemoryImage.CopyFromStreamAsync(imgStream2);
             Assert.True(image1.Equals(image2));
             Assert.True(image2.Equals(image1));
 
index f03c565..7e27c0d 100644 (file)
@@ -139,7 +139,7 @@ namespace OpenTween
 
             Assert.False(invoked);
 
-            await shortcut.RunCommand().ConfigureAwait(false);
+            await shortcut.RunCommand();
 
             Assert.True(invoked);
         }
@@ -152,13 +152,13 @@ namespace OpenTween
             var shortcut = ShortcutCommand.Create(Keys.F5)
                 .Do(async () =>
                 {
-                    await Task.Delay(100).ConfigureAwait(false);
+                    await Task.Delay(100);
                     invoked = true;
                 });
 
             Assert.False(invoked);
 
-            await shortcut.RunCommand().ConfigureAwait(false);
+            await shortcut.RunCommand();
 
             Assert.True(invoked);
         }
index 37c92c7..982b3d2 100644 (file)
@@ -212,8 +212,7 @@ namespace OpenTween.Thumbnail.Services
             var service = new FoursquareCheckin(http, ApiKey.Create("%e%INVALID_API_KEY"), ApiKey.Create("%e%INVALID_API_KEY"));
 
             var post = new PostClass();
-            var thumb = await service.GetThumbnailInfoAsync("https://www.swarmapp.com/c/xxxxxxxx", post, CancellationToken.None)
-                .ConfigureAwait(false);
+            var thumb = await service.GetThumbnailInfoAsync("https://www.swarmapp.com/c/xxxxxxxx", post, CancellationToken.None);
 
             Assert.Null(thumb);
         }
index 2c70e8e..db95058 100644 (file)
@@ -101,8 +101,7 @@ namespace OpenTween.Thumbnail.Services
             var mediaUrl = "https://pbs.twimg.com/media/DYlFv51VwAUdqWr?format=jpg&name=large";
 
             var service = new PbsTwimgCom();
-            var thumb = await service.GetThumbnailInfoAsync(mediaUrl, new PostClass(), CancellationToken.None)
-                .ConfigureAwait(false);
+            var thumb = await service.GetThumbnailInfoAsync(mediaUrl, new PostClass(), CancellationToken.None);
 
             Assert.NotNull(thumb);
             Assert.Equal("https://pbs.twimg.com/media/DYlFv51VwAUdqWr?format=jpg&name=large", thumb!.ThumbnailImageUrl);
@@ -115,8 +114,7 @@ namespace OpenTween.Thumbnail.Services
             var mediaUrl = "https://pbs.twimg.com/media/DYlFv51VwAUdqWr.jpg";
 
             var service = new PbsTwimgCom();
-            var thumb = await service.GetThumbnailInfoAsync(mediaUrl, new PostClass(), CancellationToken.None)
-                .ConfigureAwait(false);
+            var thumb = await service.GetThumbnailInfoAsync(mediaUrl, new PostClass(), CancellationToken.None);
 
             Assert.NotNull(thumb);
             Assert.Equal("https://pbs.twimg.com/media/DYlFv51VwAUdqWr?format=jpg&name=large", thumb!.ThumbnailImageUrl);
index 5a6db06..9d1455e 100644 (file)
@@ -102,8 +102,7 @@ namespace OpenTween.Thumbnail.Services
         {
             var service = new Tinami(ApiKey.Create("%e%INVALID_API_KEY"), null);
 
-            var thumbinfo = await service.GetThumbnailInfoAsync("http://www.tinami.com/view/12345", new PostClass(), CancellationToken.None)
-                .ConfigureAwait(false);
+            var thumbinfo = await service.GetThumbnailInfoAsync("http://www.tinami.com/view/12345", new PostClass(), CancellationToken.None);
 
             Assert.Null(thumbinfo);
         }
index 3ff5aba..45ab7a3 100644 (file)
@@ -91,8 +91,7 @@ namespace OpenTween.Thumbnail.Services
                 var service = new Tumblr(ApiKey.Create("fake_api_key"), http);
 
                 var url = "http://hoge.tumblr.com/post/1234567/tetetete";
-                await service.GetThumbnailInfoAsync(url, new PostClass(), CancellationToken.None)
-                    .ConfigureAwait(false);
+                await service.GetThumbnailInfoAsync(url, new PostClass(), CancellationToken.None);
             }
 
             Assert.Equal(0, handler.QueueCount);
@@ -131,8 +130,7 @@ namespace OpenTween.Thumbnail.Services
 
                 // Tumblrのカスタムドメイン名を使ってるっぽいURL
                 var url = "http://tumblr.example.com/post/1234567/tetetete";
-                await service.GetThumbnailInfoAsync(url, new PostClass(), CancellationToken.None)
-                    .ConfigureAwait(false);
+                await service.GetThumbnailInfoAsync(url, new PostClass(), CancellationToken.None);
             }
 
             Assert.Equal(0, handler.QueueCount);
@@ -147,8 +145,7 @@ namespace OpenTween.Thumbnail.Services
             var service = new Tumblr(ApiKey.Create("%e%INVALID_API_KEY"), http);
 
             var url = "http://hoge.tumblr.com/post/1234567/tetetete";
-            var thumb = await service.GetThumbnailInfoAsync(url, new PostClass(), CancellationToken.None)
-                .ConfigureAwait(false);
+            var thumb = await service.GetThumbnailInfoAsync(url, new PostClass(), CancellationToken.None);
             Assert.Null(thumb);
         }
     }
index 69d3949..635f8e8 100644 (file)
@@ -83,8 +83,7 @@ namespace OpenTween
                 Media = new() { new("http://example.com/abcd") },
             };
 
-            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None)
-                .ConfigureAwait(false);
+            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None);
 
             Assert.True(tweetThumbnail.ThumbnailAvailable);
             Assert.Single(tweetThumbnail.Thumbnails);
@@ -108,8 +107,7 @@ namespace OpenTween
                 Media = new() { new("http://hoge.example.com/") },
             };
 
-            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None)
-                .ConfigureAwait(false);
+            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None);
 
             Assert.False(tweetThumbnail.ThumbnailAvailable);
             Assert.Throws<InvalidOperationException>(() => tweetThumbnail.Thumbnails);
@@ -246,8 +244,7 @@ namespace OpenTween
                 Media = new() { new("http://example.com/abcd"), new("http://example.com/efgh") },
             };
 
-            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None)
-                .ConfigureAwait(false);
+            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None);
 
             Assert.Equal(2, tweetThumbnail.Thumbnails.Length);
             Assert.Equal(0, tweetThumbnail.SelectedIndex);
@@ -291,8 +288,7 @@ namespace OpenTween
                 Media = new() { new("http://example.com/abcd") },
             };
 
-            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None)
-                .ConfigureAwait(false);
+            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None);
 
             Assert.Equal("http://img.example.com/abcd.png", tweetThumbnail.CurrentThumbnail.ThumbnailImageUrl);
             Assert.Equal(
@@ -316,8 +312,7 @@ namespace OpenTween
                 Media = new() { new("http://example.com/abcd") },
             };
 
-            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None)
-                .ConfigureAwait(false);
+            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None);
 
             Assert.Equal("http://img.example.com/abcd.png", tweetThumbnail.CurrentThumbnail.ThumbnailImageUrl);
             Assert.Equal(
@@ -341,8 +336,7 @@ namespace OpenTween
                 Media = new() { new("http://example.com/abcd"), new("http://example.com/efgh") },
             };
 
-            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None)
-                .ConfigureAwait(false);
+            await tweetThumbnail.PrepareThumbnails(post, CancellationToken.None);
 
             Assert.Equal(2, tweetThumbnail.Thumbnails.Length);
             Assert.Equal(0, tweetThumbnail.SelectedIndex);