restore helper function

This commit is contained in:
Brendan Forster
2019-09-22 19:01:44 -03:00
parent 0c3fbeb51f
commit ac8ac6fa5b

View File

@@ -87,6 +87,21 @@ public class EnterpriseManagementConsoleClientTests
}
}
private async Task DeleteManagementAuthorizedKeyIfExists(string keyData)
{
// Check if key already exists
var keys = await _github.Enterprise.ManagementConsole.GetAllAuthorizedKeys(
EnterpriseHelper.ManagementConsolePassword);
// Delete it if so
if (keys.Any(x => x.Key == keyData))
{
await _github.Enterprise.ManagementConsole.DeleteAuthorizedKey(
new AuthorizedKeyRequest(keyData),
EnterpriseHelper.ManagementConsolePassword).ConfigureAwait(false);
}
}
[GitHubEnterpriseManagementConsoleTest]
public async Task CanGetAllAuthorizedKeys()
{