mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Release v0.24 - A Sight For Sore Eyes (#1539)
* Add release notes and bump version to 0.24 * run "build FormatCode" to fix up whitespace/formatting issues * Fix failing Ssh key tests due to "validation exception". This key must be in use on github (under another user, most likely from these tests failing). Changed to a new SSH key and tweaked tests to reduce chance of a key being created and not destroyed * Assignee and Assignees cant both be specified on NewIssue. We missed this one in the PR. Marked Assignee as [Obsolete] and fixed tests to use Assignees * Fix a couple of Reactions tests that were calling the wrong client methods * Fix timeline tests - looks like the response class has changed shape a bit, it now has an Issue object in the payload and Id field isnt present (leaving Id field there in case other timeline events do use it) * Fix some following tests that require the test user to follow more than 1 other user * Unskip these Event tests now because apparently they work! * add breaking changes notes * Update ApiErrorMessageSafe to return null for empty and whitespace strings (#1540) * return null if ApiError.Message is empty or whitespace * Uncomment test, which now passes * update release notes to include PR1540 * Add "Bot" AccountType, was causing a deserialization exception when running the integration test "SearchForExcludedLanguage" (#1541) * Update to include PR1541 * add bullets to make release notes easier to read * markup additional code mentions in notes * Fix grammar fields => field
This commit is contained in:
@@ -57,19 +57,21 @@ namespace Octokit.Tests.Integration.Clients
|
||||
[IntegrationTest]
|
||||
public async Task CanCreateAndDeleteKey()
|
||||
{
|
||||
// Create a key
|
||||
string keyTitle = "title";
|
||||
string keyData = "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAjo4DqFKg8dOxiz/yjypmN1A4itU5QOStyYrfOFuTinesU/2zm9hqxJ5BctIhgtSHJ5foxkhsiBji0qrUg73Q25BThgNg8YFE8njr4EwjmqSqW13akx/zLV0GFFU0SdJ2F6rBldhi93lMnl0ex9swBqa3eLTY8C+HQGBI6MQUMw+BKp0oFkz87Kv+Pfp6lt/Uo32ejSxML1PT5hTH5n+fyl0ied+sRmPGZWmWoHB5Bc9mox7lB6I6A/ZgjtBqbEEn4HQ2/6vp4ojKfSgA4Mm7XMu0bZzX0itKjH1QWD9Lr5apV1cmZsj49Xf8SHucTtH+bq98hb8OOXEGFzplwsX2MQ==";
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var key = await github.User.GitSshKey.Create(new NewPublicKey(keyTitle, keyData));
|
||||
// Use context helper to create/destroy a key safely (to avoid test failures when a key exists due to not having been deleted)
|
||||
string keyTitle = null;
|
||||
string keyData = null;
|
||||
using (var context = await github.CreatePublicKeyContext())
|
||||
{
|
||||
var observable = github.User.GitSshKey.Get(context.KeyId);
|
||||
var key = await observable;
|
||||
|
||||
Assert.NotNull(key);
|
||||
Assert.Equal(key.Title, "title");
|
||||
Assert.Equal(key.Key, keyData);
|
||||
Assert.NotNull(key);
|
||||
|
||||
// Delete key
|
||||
await github.User.GitSshKey.Delete(key.Id);
|
||||
keyTitle = key.Title;
|
||||
keyData = key.Key;
|
||||
}
|
||||
|
||||
// Verify key no longer exists
|
||||
var keys = await github.User.GitSshKey.GetAllForCurrent();
|
||||
|
||||
Reference in New Issue
Block a user