public void TestGetAllLoadBalancers()
        {
            RunTest((client) =>
            {
                var balancers = client.LoadBalancers.List();
                // This test should be using the SessionRecord which has an existing LoadBalancer created
                if (balancers != null)
                {
                    balancers.ForEach((loadBalancer) =>
                    {
                        //var retrieved = client.LoadBalancers.Get(loadBalancer.Name);
                        //AssertLoadBalancersAreSame(loadBalancer, retrieved);

                        NetworkCommon.ValidateBaseResources(loadBalancer);

                        ValidateBaseResourceTenant(loadBalancer);

                        Assert.NotNull(loadBalancer.PublicIpAddresses);
                        foreach (string IpAddress in loadBalancer.PublicIpAddresses)
                        {
                            Assert.NotNull(IpAddress);
                        }
                    });
                }
            });
        }
Esempio n. 2
0
 private void AssertVirtualNetworksAreSame(VirtualNetwork expected, VirtualNetwork found)
 {
     if (expected == null)
     {
         Assert.Null(found);
     }
     else
     {
         Assert.True(NetworkCommon.CheckBaseResourcesAreSame(expected, found));
     }
 }
Esempio n. 3
0
        public void TestGetAllVirtualNetworks()
        {
            RunTest((client) =>
            {
                var networks = client.VirtualNetworks.List();
                Common.MapOverIPage(networks, client.VirtualNetworks.ListNext, (network) =>
                {
                    NetworkCommon.ValidateBaseResources(network);

                    ValidateBaseResourceTenant(network);

                    ValidateConfigurationState(network.ConfigurationState);
                });
            });
        }
        private void AssertLoadBalancersAreSame(LoadBalancer expected, LoadBalancer found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(NetworkCommon.CheckBaseResourcesAreSame(expected, found));

                Assert.True(CheckBaseResourceTenantAreSame(expected, found));

                Assert.Equal(expected.PublicIpAddresses, found.PublicIpAddresses);
            }
        }
Esempio n. 5
0
        public void TestGetAllVirtualNetworksOData()
        {
            RunTest((client) =>
            {
                Microsoft.Rest.Azure.OData.ODataQuery <VirtualNetwork> odataQuery = new Microsoft.Rest.Azure.OData.ODataQuery <VirtualNetwork>();
                odataQuery.Top = 10;

                var networks = client.VirtualNetworks.List(odataQuery);
                Common.MapOverIPage(networks, client.VirtualNetworks.ListNext, (network) =>
                {
                    NetworkCommon.ValidateBaseResources(network);

                    ValidateBaseResourceTenant(network);

                    ValidateConfigurationState(network.ConfigurationState);
                });
            });
        }
Esempio n. 6
0
        private void AssertQuotasAreSame(Quota expected, Quota found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(NetworkCommon.CheckBaseResourcesAreSame(expected, found));

                Assert.Equal(expected.MaxLoadBalancersPerSubscription, found.MaxLoadBalancersPerSubscription);
                Assert.Equal(expected.MaxNicsPerSubscription, found.MaxNicsPerSubscription);
                Assert.Equal(expected.MaxPublicIpsPerSubscription, found.MaxPublicIpsPerSubscription);
                Assert.Equal(expected.MaxSecurityGroupsPerSubscription, found.MaxSecurityGroupsPerSubscription);
                Assert.Equal(expected.MaxVirtualNetworkGatewayConnectionsPerSubscription, found.MaxVirtualNetworkGatewayConnectionsPerSubscription);
                Assert.Equal(expected.MaxVirtualNetworkGatewaysPerSubscription, found.MaxVirtualNetworkGatewaysPerSubscription);
                Assert.Equal(expected.MaxVnetsPerSubscription, found.MaxVnetsPerSubscription);
                Assert.Equal(expected.MigrationPhase, found.MigrationPhase);
            }
        }
Esempio n. 7
0
        public void TestGetAllPublicIpAddresses()
        {
            RunTest((client) =>
            {
                var addresses = client.PublicIPAddresses.List();

                // This test should be using the SessionRecord which has an existing PublicIPAddress created
                if (addresses != null)
                {
                    addresses.ForEach((address) =>
                    {
                        NetworkCommon.ValidateBaseResources(address);

                        ValidateBaseResourceTenant(address);

                        Assert.NotNull(address.IpAddress);
                        Assert.NotNull(address.IpPool);
                    });
                }
            });
        }
Esempio n. 8
0
        public void TestGetAllPublicIpAddressesOData()
        {
            RunTest((client) =>
            {
                Microsoft.Rest.Azure.OData.ODataQuery <PublicIpAddress> odataQuery = new Microsoft.Rest.Azure.OData.ODataQuery <PublicIpAddress>();
                odataQuery.Top = 10;

                var addresses = client.PublicIPAddresses.List(odataQuery);

                // This test should be using the SessionRecord which has an existing PublicIPAddress created
                if (addresses != null)
                {
                    addresses.ForEach((address) =>
                    {
                        NetworkCommon.ValidateBaseResources(address);

                        ValidateBaseResourceTenant(address);

                        Assert.NotNull(address.IpAddress);
                        Assert.NotNull(address.IpPool);
                    });
                }
            });
        }