public async Task GetServerWithEmptyIdThrows() { var client = new ComputeServiceClient(GetValidCreds(), "Nova", CancellationToken.None, this.ServiceLocator); await client.GetServer(string.Empty); }
public async Task CanGetServer() { var serverId = "12345"; var expServer = new ComputeServer(serverId, "tiny", new Uri("http://testcomputeendpoint.com/v2/1234567890/servers/1"), new Uri("http://testcomputeendpoint.com/1234567890/servers/1"), new Dictionary<string, string>()); this.ServicePocoClient.GetServerDelegate = (id) => { Assert.AreEqual(serverId, id); return Task.Factory.StartNew(() => expServer); }; var client = new ComputeServiceClient(GetValidCreds(), "Nova", CancellationToken.None, this.ServiceLocator); var server = await client.GetServer(serverId); Assert.IsNotNull(server); Assert.AreEqual(expServer, server); }