Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 30bfa59

Browse files
committed
Remove async from tests with no await
1 parent 7b838d2 commit 30bfa59

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

test/UnitTests/GitHub.Api/LoginManagerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public async Task ErasesLoginWhenNonOctokitExceptionThrown()
250250
var keychain = Substitute.For<IKeychain>();
251251
var tfa = new Lazy<ITwoFactorChallengeHandler>(() => Substitute.For<ITwoFactorChallengeHandler>());
252252
var oauthListener = Substitute.For<IOAuthCallbackListener>();
253-
253+
254254
var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes);
255255
Assert.ThrowsAsync<InvalidOperationException>(async () => await target.Login(host, client, "foo", "bar"));
256256

@@ -283,7 +283,7 @@ public async Task ErasesLoginWhenNonOctokitExceptionThrownIn2FA()
283283
}
284284

285285
[Test]
286-
public async Task InvalidResponseScopesCauseException()
286+
public void InvalidResponseScopesCauseException()
287287
{
288288
var client = CreateClient(responseScopes: new[] { "user", "repo" });
289289
client.Authorization.GetOrCreateApplicationAuthentication("id", "secret", Arg.Any<NewAuthorization>())

test/UnitTests/GitHub.App/Caches/ImageCacheTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task WhenLoadingFromCacheFailsInvalidatesCacheEntry()
5555
Assert.That(retrieved, Is.Null);
5656
Assert.ThrowsAsync<KeyNotFoundException>(async () => await cache.Get("https://fake/"));
5757
}
58-
58+
5959
[Test]
6060
public async Task DownloadsImageWhenMissingAndCachesIt()
6161
{
@@ -76,7 +76,7 @@ public async Task DownloadsImageWhenMissingAndCachesIt()
7676
}
7777

7878
[Test]
79-
public async Task ThrowsKeyNotFoundExceptionWhenItemNotInCacheAndImageFetchThrowsException()
79+
public void ThrowsKeyNotFoundExceptionWhenItemNotInCacheAndImageFetchThrowsException()
8080
{
8181
var imageUri = new Uri("https://example.com/poop.gif");
8282
var cacheFactory = Substitute.For<IBlobCacheFactory>();
@@ -91,7 +91,7 @@ public async Task ThrowsKeyNotFoundExceptionWhenItemNotInCacheAndImageFetchThrow
9191
}
9292

9393
[Test]
94-
public async Task ThrowsKeyNotFoundExceptionWhenItemNotInCacheAndImageFetchReturnsEmpty()
94+
public void ThrowsKeyNotFoundExceptionWhenItemNotInCacheAndImageFetchReturnsEmpty()
9595
{
9696
var imageUri = new Uri("https://example.com/poop.gif");
9797
var cache = new InMemoryBlobCache();

test/UnitTests/GitHub.App/Services/PullRequestServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public async Task ExtractBase_MergeBaseAvailable_UseMergeBaseSha()
291291
}
292292

293293
[Test]
294-
public async Task MergeBaseNotAvailable_ThrowsNotFoundException()
294+
public void MergeBaseNotAvailable_ThrowsNotFoundException()
295295
{
296296
var baseFileContent = "baseFileContent";
297297
var headFileContent = "headFileContent";

test/UnitTests/GitHub.VisualStudio/Services/ConnectionManagerTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public async Task ReturnsInvalidConnections()
4747
var result = await target.GetLoadedConnections();
4848

4949
Assert.That(2, Is.EqualTo(result.Count));
50-
Assert.That("https://github.com/",Is.EqualTo(result[0].HostAddress.WebUri.ToString()));
50+
Assert.That("https://github.com/", Is.EqualTo(result[0].HostAddress.WebUri.ToString()));
5151
Assert.That("https://invalid.com/", Is.EqualTo(result[1].HostAddress.WebUri.ToString()));
5252
Assert.That(result[0].ConnectionError, Is.Null);
5353
Assert.That(result[1].ConnectionError, Is.Not.Null);
@@ -121,7 +121,7 @@ public async Task AddsLoggedInConnectionToConnections()
121121
}
122122

123123
[Test]
124-
public async Task ThrowsWhenLoginFails()
124+
public void ThrowsWhenLoginFails()
125125
{
126126
var target = new ConnectionManager(
127127
CreateProgram(),
@@ -136,7 +136,7 @@ public async Task ThrowsWhenLoginFails()
136136
}
137137

138138
[Test]
139-
public async Task ThrowsWhenExistingConnectionExists()
139+
public void ThrowsWhenExistingConnectionExists()
140140
{
141141
var target = new ConnectionManager(
142142
CreateProgram(),
@@ -208,7 +208,7 @@ public async Task RemovesConnectionFromConnections()
208208
}
209209

210210
[Test]
211-
public async Task ThrowsIfConnectionDoesntExist()
211+
public void ThrowsIfConnectionDoesntExist()
212212
{
213213
var loginManager = CreateLoginManager();
214214
var target = new ConnectionManager(

0 commit comments

Comments
 (0)