public void TestListAddressesByNetwork() { IComputeProvider provider = new CloudServersProvider(Bootstrapper.Settings.TestIdentity); INetworksProvider networksProvider = new CloudNetworksProvider(Bootstrapper.Settings.TestIdentity); IEnumerable <CloudNetwork> networks = networksProvider.ListNetworks(); bool foundAddress = false; foreach (CloudNetwork network in networks) { Console.WriteLine("Network: {0}", network.Label); IEnumerable <IPAddress> addresses = provider.ListAddressesByNetwork(_server.Id, network.Label); foreach (IPAddress address in addresses) { foundAddress = true; Console.WriteLine(" {0}", address); } } if (!foundAddress) { Assert.Inconclusive("Couldn't find addresses on any network for the server."); } }
public void Should_Return_Addresses_By_Network_Name_For_Server2() { var provider = new CloudServersProvider(_testIdentity); var addresses = provider.ListAddressesByNetwork(_testServer2.Id, "public"); Assert.IsTrue(addresses.Any()); }
public void TestListAddressesByNetwork() { IComputeProvider provider = new CloudServersProvider(Bootstrapper.Settings.TestIdentity); INetworksProvider networksProvider = new CloudNetworksProvider(Bootstrapper.Settings.TestIdentity); IEnumerable<CloudNetwork> networks = networksProvider.ListNetworks(); bool foundAddress = false; foreach (CloudNetwork network in networks) { Console.WriteLine("Network: {0}", network.Label); IEnumerable<IPAddress> addresses = provider.ListAddressesByNetwork(_server.Id, network.Label); foreach (IPAddress address in addresses) { foundAddress = true; Console.WriteLine(" {0}", address); } } if (!foundAddress) Assert.Inconclusive("Couldn't find addresses on any network for the server."); }