Skip to content

Commit 6f13e76

Browse files
committed
Properly await Assert.ThrowsAsync() calls
Pointed out by Visual Studio. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a749c92 commit 6f13e76

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/shared/Core.Tests/Authentication/BasicAuthenticationTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ namespace GitCredentialManager.Tests.Authentication
1212
public class BasicAuthenticationTests
1313
{
1414
[Fact]
15-
public void BasicAuthentication_GetCredentials_NullResource_ThrowsException()
15+
public async Task BasicAuthentication_GetCredentials_NullResource_ThrowsException()
1616
{
1717
var context = new TestCommandContext();
1818
var basicAuth = new BasicAuthentication(context);
1919

20-
Assert.ThrowsAsync<ArgumentNullException>(() => basicAuth.GetCredentialsAsync(null));
20+
await Assert.ThrowsAsync<ArgumentNullException>(() => basicAuth.GetCredentialsAsync(null));
2121
}
2222

2323
[Fact]
@@ -58,7 +58,7 @@ public async Task BasicAuthentication_GetCredentials_NonDesktopSession_Resource_
5858
}
5959

6060
[Fact]
61-
public void BasicAuthentication_GetCredentials_NonDesktopSession_NoTerminalPrompts_ThrowsException()
61+
public async Task BasicAuthentication_GetCredentials_NonDesktopSession_NoTerminalPrompts_ThrowsException()
6262
{
6363
const string testResource = "https://example.com";
6464

@@ -70,7 +70,7 @@ public void BasicAuthentication_GetCredentials_NonDesktopSession_NoTerminalPromp
7070

7171
var basicAuth = new BasicAuthentication(context);
7272

73-
Assert.ThrowsAsync<InvalidOperationException>(() => basicAuth.GetCredentialsAsync(testResource));
73+
await Assert.ThrowsAsync<InvalidOperationException>(() => basicAuth.GetCredentialsAsync(testResource));
7474
}
7575

7676
[Fact]

src/shared/Core.Tests/HostProviderRegistryTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public void HostProviderRegistry_Register_AutoAuthorityId_ThrowException()
3535
}
3636

3737
[Fact]
38-
public void HostProviderRegistry_GetProvider_NoProviders_ThrowException()
38+
public async Task HostProviderRegistry_GetProvider_NoProviders_ThrowException()
3939
{
4040
var context = new TestCommandContext();
4141
var registry = new HostProviderRegistry(context);
4242
var input = new InputArguments(new Dictionary<string, string>());
4343

44-
Assert.ThrowsAsync<Exception>(() => registry.GetProviderAsync(input));
44+
await Assert.ThrowsAsync<Exception>(() => registry.GetProviderAsync(input));
4545
}
4646

4747
[Fact]

0 commit comments

Comments
 (0)