public void GetConfigurationThrowsResourceNotFoundWhenNoConfigurationExists()
        {
            using (NetworkTestClient testClient = new NetworkTestClient())
            {
                testClient.EnsureNoNetworkConfigurationExists();

                try
                {
                    testClient.GetNetworkConfiguration();
                }
                catch (Hyak.Common.CloudException e)
                {
                    Assert.Equal("ResourceNotFound", e.Error.Code);
                }
            }
        }
        public void DeleteConfiguration()
        {
            using (NetworkTestClient networkTestClient = new NetworkTestClient())
            {
                networkTestClient.Gateways.EnsureNoGatewayExists();

                OperationStatusResponse response = networkTestClient.SetNetworkConfiguration(NetworkTestConstants.EmptyNetworkConfigurationParameters);
                Assert.NotNull(response);
                Assert.Equal(HttpStatusCode.OK, response.HttpStatusCode);

                try
                {
                    networkTestClient.GetNetworkConfiguration();
                }
                catch (Hyak.Common.CloudException e)
                {
                    Assert.Equal("ResourceNotFound", e.Error.Code);
                }
            }
        }
        public void SetWideVNetConfiguration()
        {
            using (NetworkTestClient networkTestClient = new NetworkTestClient())
            {
                networkTestClient.Gateways.EnsureNoGatewayExists();

                OperationStatusResponse response = networkTestClient.SetNetworkConfiguration(NetworkTestConstants.WideVNetNetworkConfigurationParameters);
                Assert.NotNull(response);
                Assert.Equal(HttpStatusCode.OK, response.HttpStatusCode);

                NetworkGetConfigurationResponse getConfigurationResponse = networkTestClient.GetNetworkConfiguration();
                Assert.NotNull(getConfigurationResponse);

                string responseConfiguration = getConfigurationResponse.Configuration;
                Assert.NotNull(responseConfiguration);
                Assert.NotEmpty(responseConfiguration);
                Assert.True(responseConfiguration.Contains(NetworkTestConstants.VirtualNetworkSiteName));
                Assert.True(responseConfiguration.Contains(NetworkTestConstants.WideVNetLocation));
                Assert.True(responseConfiguration.Contains(NetworkTestConstants.WideVNetSubnetName));
            }
        }
        public void SetSiteToSiteConfiguration()
        {
            using (NetworkTestClient networkTestClient = new NetworkTestClient())
            {
                networkTestClient.Gateways.EnsureNoGatewayExists();

                OperationStatusResponse response = networkTestClient.SetNetworkConfiguration(NetworkTestConstants.SiteToSiteNetworkConfigurationParameters);
                Assert.NotNull(response);
                Assert.Equal(HttpStatusCode.OK, response.HttpStatusCode);

                NetworkGetConfigurationResponse getConfigurationResponse = networkTestClient.GetNetworkConfiguration();
                Assert.NotNull(getConfigurationResponse);

                string responseConfiguration = getConfigurationResponse.Configuration;
                Assert.NotNull(responseConfiguration);
                Assert.NotEmpty(responseConfiguration);
                Assert.True(responseConfiguration.Contains("localNetworkSiteName"));
                Assert.True(responseConfiguration.Contains("virtualNetworkSiteName"));
                Assert.True(responseConfiguration.Contains("affinityGroupName"));
                Assert.True(responseConfiguration.Contains("192.168.0.0/24"));
            }
        }