Tweak GpgKeyContext inline with recent change made to other helper contexts

This commit is contained in:
Ryan Gribble
2016-06-09 00:03:07 +10:00
parent 9e594a6451
commit 3977765796
4 changed files with 22 additions and 10 deletions
@@ -8,15 +8,16 @@ namespace Octokit.Tests.Integration.Helpers
{
public class GpgKeyContext : IDisposable
{
internal GpgKeyContext(GpgKey key)
internal GpgKeyContext(IConnection connection, GpgKey key)
{
_connection = connection;
Key = key;
GpgKeyId = key.Id;
KeyId = key.KeyId;
PublicKeyData = key.PublicKey;
}
private IConnection _connection;
internal int GpgKeyId { get; set; }
internal string KeyId { get; set; }
internal string PublicKeyData { get; set; }
@@ -27,12 +28,7 @@ namespace Octokit.Tests.Integration.Helpers
{
if (Key != null)
{
var api = Helper.GetBasicAuthClient();
try
{
api.User.GpgKey.Delete(Key.Id).Wait(TimeSpan.FromSeconds(15));
}
catch { }
Helper.DeleteGpgKey(_connection, Key);
}
}
}