コード例 #1
0
        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.");
            }
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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.");
        }