mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 04:16:51 +00:00
Add integration tests for UserGpgKeysClient
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit.Tests.Integration.Helpers
|
||||
{
|
||||
public class GpgKeyContext : IDisposable
|
||||
{
|
||||
internal GpgKeyContext(GpgKey key)
|
||||
{
|
||||
Key = key;
|
||||
GpgKeyId = key.Id;
|
||||
KeyId = key.KeyId;
|
||||
PublicKeyData = key.PublicKey;
|
||||
}
|
||||
|
||||
|
||||
internal int GpgKeyId { get; set; }
|
||||
internal string KeyId { get; set; }
|
||||
internal string PublicKeyData { get; set; }
|
||||
|
||||
internal GpgKey Key { get; set; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Key != null)
|
||||
{
|
||||
var api = Helper.GetBasicAuthClient();
|
||||
try
|
||||
{
|
||||
api.User.GpgKeys.Delete(Key.Id).Wait(TimeSpan.FromSeconds(15));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user