public async Task GetKeyPairWithEmptyNameThrows() { var client = new ComputeServiceClient(GetValidCreds(), "Nova", CancellationToken.None, this.ServiceLocator); await client.GetKeyPair(string.Empty); }
public async Task CanGetKeyPair() { var keyName = "1"; var expKeyPair1 = new ComputeKeyPair(keyName, "ABCDEF", "12345"); this.ServicePocoClient.GetKeyPairDelegate = (name) => { Assert.AreEqual(keyName, name); return Task.Factory.StartNew(() => expKeyPair1); }; var client = new ComputeServiceClient(GetValidCreds(), "Nova", CancellationToken.None, this.ServiceLocator); var keyPair = await client.GetKeyPair(keyName); Assert.IsNotNull(keyPair); Assert.AreEqual(expKeyPair1, keyPair); }