Fix async tests (#1631)

* Fix up Assert.ThrowsAsync tests to actually await the call

* ... and it even picked up a missing null check... pay day!
This commit is contained in:
Ryan Gribble
2017-07-23 09:03:10 +10:00
committed by GitHub
parent 329ef960ed
commit db74c3b4ad
12 changed files with 80 additions and 73 deletions
@@ -184,7 +184,7 @@ namespace Octokit.Tests.Integration.Clients
Assert.Equal(created.Token, applicationAuthorization.Token);
await github.Authorization.Delete(created.Id);
Assert.ThrowsAsync<NotFoundException>(() => github.Authorization.Get(created.Id));
await Assert.ThrowsAsync<NotFoundException>(() => github.Authorization.Get(created.Id));
}
[BasicAuthenticationTest]
@@ -210,7 +210,7 @@ namespace Octokit.Tests.Integration.Clients
Assert.NotEqual(created.Token, applicationAuthorization.Token);
await github.Authorization.Delete(created.Id);
Assert.ThrowsAsync<NotFoundException>(() => github.Authorization.Get(created.Id));
await Assert.ThrowsAsync<NotFoundException>(() => github.Authorization.Get(created.Id));
}
[BasicAuthenticationTest]
@@ -232,8 +232,8 @@ namespace Octokit.Tests.Integration.Clients
var applicationClient = Helper.GetAuthenticatedApplicationClient();
await applicationClient.Authorization.RevokeApplicationAuthentication(Helper.ClientId, created.Token);
Assert.ThrowsAsync<NotFoundException>(() => applicationClient.Authorization.CheckApplicationAuthentication(Helper.ClientId, created.Token));
Assert.ThrowsAsync<NotFoundException>(() => github.Authorization.Get(created.Id));
await Assert.ThrowsAsync<NotFoundException>(() => applicationClient.Authorization.CheckApplicationAuthentication(Helper.ClientId, created.Token));
await Assert.ThrowsAsync<NotFoundException>(() => github.Authorization.Get(created.Id));
}
}
}