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);
                        }
                    });
                }
            });
        }
예제 #2
0
 private void AssertVirtualNetworksAreSame(VirtualNetwork expected, VirtualNetwork found)
 {
     if (expected == null)
     {
         Assert.Null(found);
     }
     else
     {
         Assert.True(NetworkCommon.CheckBaseResourcesAreSame(expected, found));
     }
 }
예제 #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);
            }
        }
예제 #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);
                });
            });
        }
예제 #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);
            }
        }
예제 #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);
                    });
                }
            });
        }
예제 #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);
                    });
                }
            });
        }