本文整理汇总了C#中NetworkTestClient类的典型用法代码示例。如果您正苦于以下问题:C# NetworkTestClient类的具体用法?C# NetworkTestClient怎么用?C# NetworkTestClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkTestClient类属于命名空间,在下文中一共展示了NetworkTestClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: StartDiagnosticsWithNoCustomerStorageName
public void StartDiagnosticsWithNoCustomerStorageName()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.EnsureSiteToSiteNetworkConfigurationExists();
StartGatewayPublicDiagnosticsParameters parameters = new StartGatewayPublicDiagnosticsParameters()
{
Operation = UpdateGatewayPublicDiagnosticsOperation.StartDiagnostics,
CustomerStorageKey = "EyXneSsrZJJbBT4bHL6p4KdO+S5YCtM75PAA1gVWd39vwHm2CHfosBRRDkJYJWpY2mpnYlMROpgqmEci6b3u0w==",
ContainerName = "hydra-test-diagnostics",
CaptureDurationInSeconds = "1",
};
try
{
networkTestClient.Gateways.StartDiagnostics(NetworkTestConstants.VirtualNetworkSiteName, parameters);
Assert.True(false, "UpdateDiagnostics should have thrown a CloudException.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("BadRequest", e.Error.Code);
Assert.True(e.Error.Message.Contains("CustomerStorageName was not valid"));
}
}
}
开发者ID:theadriangreen,项目名称:azure-sdk-for-net,代码行数:26,代码来源:StartDiagnosticsTests.cs
示例2: ResizeGatewayWithNotProvisionedGateway
public void ResizeGatewayWithNotProvisionedGateway()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Gateways.EnsureNoGatewayExists();
networkTestClient.EnsureSiteToSiteNetworkConfigurationExists();
ResizeGatewayParameters parameters = new ResizeGatewayParameters()
{
GatewaySKU = GatewaySKU.HighPerformance,
};
try
{
networkTestClient.Gateways.ResizeGateway(NetworkTestConstants.VirtualNetworkSiteName, parameters);
Assert.True(false, "ResizeGateway should have thrown a CloudException when the virtual network gateway was not provisioned.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("BadRequest", e.Error.Code);
Assert.Equal("The current provisioning status of the gateway prevents this operation.", e.Error.Message);
Assert.NotNull(e.Response);
Assert.Equal("Bad Request", e.Response.ReasonPhrase);
Assert.Equal(HttpStatusCode.BadRequest, e.Response.StatusCode);
}
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:27,代码来源:ResizeGatewayTests.cs
示例3: GenerateVpnClientPackageWithStaticRoutingGatewayWithNoClientRootCertificates
public void GenerateVpnClientPackageWithStaticRoutingGatewayWithNoClientRootCertificates()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Gateways.EnsureStaticRoutingGatewayExists();
GatewayGenerateVpnClientPackageParameters parameters = new GatewayGenerateVpnClientPackageParameters()
{
ProcessorArchitecture = GatewayProcessorArchitecture.Amd64,
};
try
{
networkTestClient.Gateways.GenerateVpnClientPackage(NetworkTestConstants.VirtualNetworkSiteName, parameters);
Assert.True(false, "GenerateVpnClientPackage should throw a CloudException when there are no client root certificates uploaded for this virtual network.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("ResourceNotFound", e.Error.Code);
Assert.Equal("There must be at least one client root certificate authority installed on the Gateway", e.Error.Message);
Assert.NotNull(e.Response);
Assert.Equal("Not Found", e.Response.ReasonPhrase);
Assert.Equal(HttpStatusCode.NotFound, e.Response.StatusCode);
}
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:26,代码来源:GenerateVpnClientPackageTests.cs
示例4: StartDiagnosticsWithNotFoundVirtualNetworkName
public void StartDiagnosticsWithNotFoundVirtualNetworkName()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
StartGatewayPublicDiagnosticsParameters parameters = new StartGatewayPublicDiagnosticsParameters()
{
Operation = UpdateGatewayPublicDiagnosticsOperation.StartDiagnostics,
CustomerStorageName = "daschult20140611a",
CustomerStorageKey = "EyXneSsrZJJbBT4bHL6p4KdO+S5YCtM75PAA1gVWd39vwHm2CHfosBRRDkJYJWpY2mpnYlMROpgqmEci6b3u0w==",
ContainerName = "hydra-test-diagnostics",
CaptureDurationInSeconds = "1",
};
const string virtualNetworkName = "NotFoundVirtualNetworkName";
try
{
networkTestClient.Gateways.StartDiagnostics(virtualNetworkName, parameters);
Assert.True(false, "UpdateDiagnostics should have thrown a CloudException when a virtual network name was provided that didn't exist.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("BadRequest", e.Error.Code);
Assert.Contains(virtualNetworkName, e.Error.Message);
Assert.Contains("not valid or could not be found", e.Error.Message);
}
}
}
开发者ID:theadriangreen,项目名称:azure-sdk-for-net,代码行数:28,代码来源:StartDiagnosticsTests.cs
示例5: ResetSharedKey
public void ResetSharedKey()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.SetNetworkConfiguration(NetworkTestConstants.SiteToSiteNetworkConfigurationParameters);
networkTestClient.Gateways.CreateGateway(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.CreateStaticRoutingGatewayParameters());
GatewayGetSharedKeyResponse firstGetResponse = networkTestClient.Gateways.GetSharedKey(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.LocalNetworkSiteName);
string firstSharedKey = firstGetResponse.SharedKey;
GatewayResetSharedKeyParameters parameters = new GatewayResetSharedKeyParameters()
{
KeyLength = 128,
};
GatewayGetOperationStatusResponse resetResponse = networkTestClient.Gateways.ResetSharedKey(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.LocalNetworkSiteName, parameters);
Assert.NotNull(resetResponse);
Assert.Equal(HttpStatusCode.OK, resetResponse.HttpStatusCode);
GatewayGetSharedKeyResponse secondGetResponse = networkTestClient.Gateways.GetSharedKey(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.LocalNetworkSiteName);
string secondSharedKey = secondGetResponse.SharedKey;
Assert.NotEqual(firstSharedKey, secondSharedKey);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:25,代码来源:ResetSharedKeyTests.cs
示例6: GenerateVpnClientPackageWithStaticRoutingConfiguration
public void GenerateVpnClientPackageWithStaticRoutingConfiguration()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.EnsureSiteToSiteNetworkConfigurationExists();
networkTestClient.Gateways.EnsureNoGatewayExists();
const string networkName = "virtualNetworkSiteName";
GatewayGenerateVpnClientPackageParameters parameters = new GatewayGenerateVpnClientPackageParameters()
{
ProcessorArchitecture = GatewayProcessorArchitecture.Amd64,
};
try
{
networkTestClient.Gateways.GenerateVpnClientPackage(networkName, parameters);
Assert.True(false, "GenerateVpnClientPackage should have thrown a CloudException when the networkName was empty.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("BadRequest", e.Error.Code);
Assert.Contains("current provisioning status of the gateway prevents this operation", e.Error.Message, StringComparison.InvariantCultureIgnoreCase);
}
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:25,代码来源:GenerateVpnClientPackageTests.cs
示例7: AddRouteTableToSubnetWithNonExistantVNetName
public void AddRouteTableToSubnetWithNonExistantVNetName()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.EnsureNoNetworkConfigurationExists();
networkTestClient.Routes.EnsureRouteTableExists("MockRouteTableName");
AddRouteTableToSubnetParameters parameters = new AddRouteTableToSubnetParameters()
{
RouteTableName = "MockRouteTableName"
};
try
{
networkTestClient.Routes.AddRouteTableToSubnet(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.WideVNetSubnetName, parameters);
Assert.True(false, "AddRouteTableToSubnet should have thrown a CloudException when the parameters object's route table name was empty.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("ResourceNotFound", e.Error.Code);
Assert.Equal("The virtual network virtualNetworkSiteName does not exist.", e.Error.Message);
Assert.Null(e.Response);
}
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:25,代码来源:AddRouteTableToSubnetTests.cs
示例8: AddRouteTableToSubnetWithNonExistantSubnetName
public void AddRouteTableToSubnetWithNonExistantSubnetName()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.EnsureWideVNetNetworkConfigurationExists();
networkTestClient.Routes.EnsureRouteTableExists("MockRouteTableName");
AddRouteTableToSubnetParameters parameters = new AddRouteTableToSubnetParameters()
{
RouteTableName = "MockRouteTableName"
};
try
{
networkTestClient.Routes.AddRouteTableToSubnet(NetworkTestConstants.VirtualNetworkSiteName, "NonExistantSubnetName", parameters);
Assert.True(false, "AddRouteTableToSubnet should have thrown a CloudException when the subnetName did not exist in the current vnet.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("ResourceNotFound", e.Error.Code);
Assert.Equal("Subnet name NonExistantSubnetName was not found in Virtual Network virtualNetworkSiteName.", e.Error.Message);
Assert.Null(e.Response);
}
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:25,代码来源:AddRouteTableToSubnetTests.cs
示例9: SetDefaultSitesWhenGatewayIsNotProvisioned
public void SetDefaultSitesWhenGatewayIsNotProvisioned()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.EnsureSiteToSiteNetworkConfigurationExists();
networkTestClient.Gateways.EnsureNoGatewayExists();
const string virtualNetworkSiteName = NetworkTestConstants.VirtualNetworkSiteName;
GatewaySetDefaultSiteListParameters parameters = CreateParameters("localNetworkSiteName");
try
{
networkTestClient.Gateways.SetDefaultSites(virtualNetworkSiteName, parameters);
Assert.True(false, "SetDefaultSites should throw an CloudException when the gateway was not provisioned.");
}
catch (Hyak.Common.CloudException e)
{
Assert.NotNull(e.Response);
Assert.Equal("BadRequest", e.Error.Code);
Assert.True(e.Error.Message.Contains("current provisioning status of the gateway prevents this operation"));
Assert.Equal(HttpStatusCode.BadRequest, e.Response.StatusCode);
Assert.Equal("Bad Request", e.Response.ReasonPhrase);
}
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:26,代码来源:SetDefaultSitesTests.cs
示例10: CreateApplicationGateway
public void CreateApplicationGateway()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
ApplicationGatewayOperationResponse result = new ApplicationGatewayOperationResponse();
//CREATE gateway
var createParams = new CreateApplicationGatewayParameters
{
Name = gatewayName,
Description = gatewayDescription,
VnetName = vnet,
Subnets = new List<string>() { subnet }
};
result = networkTestClient.ApplicationGateways.CreateApplicationGateway(createParams);
Assert.Equal(result.StatusCode, HttpStatusCode.OK);
//SET gateway config
ApplicationGatewaySetConfiguration config = GenerateConfig();
result = networkTestClient.ApplicationGateways.SetConfigApplicationGateway(gatewayName, config);
Assert.Equal(result.StatusCode, HttpStatusCode.OK);
//START gateway
result = networkTestClient.ApplicationGateways.StartApplicationGateway(gatewayName);
Assert.Equal(result.StatusCode, HttpStatusCode.OK);
}
}
开发者ID:thomasyip-msft,项目名称:azure-sdk-for-net,代码行数:29,代码来源:SetupApplicationGatewayTests.cs
示例11: SetSharedKey
public void SetSharedKey()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Gateways.EnsureStaticRoutingGatewayExists();
GatewayResetSharedKeyParameters resetParameters = new GatewayResetSharedKeyParameters()
{
KeyLength = 128,
};
GatewayGetOperationStatusResponse resetResponse = networkTestClient.Gateways.ResetSharedKey(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.LocalNetworkSiteName, resetParameters);
Assert.NotNull(resetResponse);
Assert.Equal(HttpStatusCode.OK, resetResponse.HttpStatusCode);
const string sharedKeyToSet = "ABC";
GatewayGetSharedKeyResponse firstGetResponse = networkTestClient.Gateways.GetSharedKey(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.LocalNetworkSiteName);
Assert.NotEqual(sharedKeyToSet, firstGetResponse.SharedKey);
GatewaySetSharedKeyParameters setParameters = new GatewaySetSharedKeyParameters()
{
Value = sharedKeyToSet,
};
GatewayGetOperationStatusResponse setResponse = networkTestClient.Gateways.SetSharedKey(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.LocalNetworkSiteName, setParameters);
Assert.NotNull(setResponse);
Assert.Equal(HttpStatusCode.OK, setResponse.HttpStatusCode);
GatewayGetSharedKeyResponse secondGetResponse = networkTestClient.Gateways.GetSharedKey(NetworkTestConstants.VirtualNetworkSiteName, NetworkTestConstants.LocalNetworkSiteName);
Assert.Equal(sharedKeyToSet, secondGetResponse.SharedKey);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:34,代码来源:SetSharedKeyTests.cs
示例12: ListRouteTablesWhenTwoTablesExist
public void ListRouteTablesWhenTwoTablesExist()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Routes.EnsureNoRouteTablesExist();
networkTestClient.Routes.EnsureRouteTableExists("MockRouteTableA");
networkTestClient.Routes.EnsureRouteTableExists("MockRouteTableB");
ListRouteTablesResponse listResponse = networkTestClient.Routes.ListRouteTables();
Assert.NotNull(listResponse);
Assert.NotNull(listResponse.RouteTables);
Assert.Equal(2, listResponse.RouteTables.Count);
RouteTable mockRouteTableA = listResponse.RouteTables[0];
Assert.Equal("MockRouteTableA", mockRouteTableA.Name);
Assert.Equal("MockLabel", mockRouteTableA.Label);
Assert.Equal(NetworkTestConstants.WideVNetLocation, mockRouteTableA.Location);
Assert.Equal(RouteTableState.Created, mockRouteTableA.RouteTableState);
RouteTable mockRouteTableB = listResponse.RouteTables[1];
Assert.Equal("MockRouteTableB", mockRouteTableB.Name);
Assert.Equal("MockLabel", mockRouteTableB.Label);
Assert.Equal(NetworkTestConstants.WideVNetLocation, mockRouteTableB.Location);
Assert.Equal(RouteTableState.Created, mockRouteTableB.RouteTableState);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:26,代码来源:ListRouteTablesTests.cs
示例13: ResizeStaticRoutingGateway
public void ResizeStaticRoutingGateway()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Gateways.EnsureStaticRoutingGatewayExists();
ResizeGatewayParameters parameters = new ResizeGatewayParameters()
{
GatewaySKU = GatewaySKU.HighPerformance,
};
try
{
networkTestClient.Gateways.ResizeGateway(NetworkTestConstants.VirtualNetworkSiteName, parameters);
Assert.True(false, "ResizeGateway should have thrown a CloudException when it was run against a StaticRouting gateway.");
}
catch (Hyak.Common.CloudException e)
{
Assert.Equal("BadRequest", e.Error.Code);
Assert.Equal("The current operation or request is invalid against Static-Routing gateway.", e.Error.Message);
Assert.NotNull(e.Response);
Assert.Equal("Bad Request", e.Response.ReasonPhrase);
Assert.Equal(HttpStatusCode.BadRequest, e.Response.StatusCode);
}
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:26,代码来源:ResizeGatewayTests.cs
示例14: PrepareAndAbortMigrationRouteTable
public void PrepareAndAbortMigrationRouteTable()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Routes.EnsureRouteTableDoesntExist("MockName");
CreateRouteTableParameters parameters = CreateParameters("MockName", null, NetworkTestConstants.WideVNetLocation);
AzureOperationResponse createResponse = networkTestClient.Routes.CreateRouteTable(parameters);
Assert.NotNull(createResponse);
Assert.NotNull(createResponse.RequestId);
Assert.NotEqual(0, createResponse.RequestId.Length);
Assert.Equal(HttpStatusCode.OK, createResponse.StatusCode);
// Test Validate migration call
var response = networkTestClient.ValidateRouteTableMigration("MockName");
Assert.NotNull(response);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.NotNull(response.ValidationMessages);
Assert.Equal(0, response.ValidationMessages.Count);
// Prepare
OperationStatusResponse prepareVnetMigration = networkTestClient.PrepareRouteTableMigration("MockName");
Assert.Equal(OperationStatus.Succeeded, prepareVnetMigration.Status);
// Abort
OperationStatusResponse abortVnetMigration = networkTestClient.AbortRouteTableMigration("MockName");
Assert.Equal(OperationStatus.Succeeded, abortVnetMigration.Status);
}
}
开发者ID:bganapa,项目名称:azure-sdk-for-net,代码行数:31,代码来源:MigrateRouteTableTests.cs
示例15: ListWhenNoConfigurationExists
public void ListWhenNoConfigurationExists()
{
using (NetworkTestClient testClient = new NetworkTestClient())
{
testClient.EnsureNoNetworkConfigurationExists();
NetworkListResponse listResponse = testClient.ListNetworkConfigurations();
Assert.NotNull(listResponse);
Assert.False(listResponse.Any(), "List() should have returned an empty list if no configurations exist.");
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:11,代码来源:ListTests.cs
示例16: GetDiagnostics
public void GetDiagnostics()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Gateways.EnsureStaticRoutingGatewayExists();
GatewayDiagnosticsStatus status = networkTestClient.Gateways.GetDiagnostics(NetworkTestConstants.VirtualNetworkSiteName);
Assert.NotNull(status);
Assert.Equal(GatewayDiagnosticsState.Ready, status.State);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:11,代码来源:GetDiagnosticsTests.cs
示例17: StartDiagnostics
public void StartDiagnostics()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Gateways.EnsureStaticRoutingGatewayExists();
StartGatewayPublicDiagnosticsParameters startParameters = new StartGatewayPublicDiagnosticsParameters()
{
Operation = UpdateGatewayPublicDiagnosticsOperation.StartDiagnostics,
CustomerStorageName = "daschult20140611a",
// [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine")]
CustomerStorageKey = "EyXneSsrZJJbBT4bHL6p4KdO+S5YCtM75PAA1gVWd39vwHm2CHfosBRRDkJYJWpY2mpnYlMROpgqmEci6b3u0w==",
ContainerName = "hydra-test-diagnostics",
CaptureDurationInSeconds = "300",
};
GatewayGetOperationStatusResponse startResponse = networkTestClient.Gateways.StartDiagnostics(NetworkTestConstants.VirtualNetworkSiteName, startParameters);
Assert.NotNull(startResponse);
Assert.Equal(HttpStatusCode.OK, startResponse.HttpStatusCode);
GatewayDiagnosticsStatus startStatus = networkTestClient.Gateways.GetDiagnostics(NetworkTestConstants.VirtualNetworkSiteName);
Assert.NotNull(startStatus);
Assert.True(startStatus.DiagnosticsUrl != null, "The diagnostics url was null.");
Assert.Equal(GatewayDiagnosticsState.InProgress, startStatus.State);
StopGatewayPublicDiagnosticsParameters stopParameters = new StopGatewayPublicDiagnosticsParameters();
try
{
networkTestClient.Gateways.StopDiagnostics(NetworkTestConstants.VirtualNetworkSiteName, stopParameters);
Assert.True(false, "StopDiagnostics should throw a CloudException because the REST API is expecting a 202 (Accepted) status code, but GatewayManager is returning a 200 (OK).");
}
catch (Hyak.Common.CloudException e)
{
Assert.Null(e.Error.Code);
Assert.Null(e.Error.Message);
Assert.NotNull(e.Response);
Assert.Equal(HttpStatusCode.OK, e.Response.StatusCode);
Assert.Equal("OK", e.Response.ReasonPhrase);
}
GatewayDiagnosticsStatus stopStatus;
do
{
stopStatus = networkTestClient.Gateways.GetDiagnostics(NetworkTestConstants.VirtualNetworkSiteName);
Assert.NotNull(stopStatus);
} while (stopStatus.State != GatewayDiagnosticsState.Ready);
Assert.Equal(GatewayDiagnosticsState.Ready, stopStatus.State);
Assert.True(stopStatus.DiagnosticsUrl != null, "The diagnostics url was null.");
Assert.True(1 <= stopStatus.DiagnosticsUrl.Length, "The diagnostics url was empty.");
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:54,代码来源:StartDiagnosticsTests.cs
示例18: ListRouteTablesWhenNoTablesExist
public void ListRouteTablesWhenNoTablesExist()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Routes.EnsureNoRouteTablesExist();
ListRouteTablesResponse listResponse = networkTestClient.Routes.ListRouteTables();
Assert.NotNull(listResponse);
Assert.NotNull(listResponse.RouteTables);
Assert.Equal(0, listResponse.RouteTables.Count);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:12,代码来源:ListRouteTablesTests.cs
示例19: GetGatewayWhenGatewayIsNotProvisioned
public void GetGatewayWhenGatewayIsNotProvisioned()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.EnsureSiteToSiteNetworkConfigurationExists();
networkTestClient.Gateways.EnsureNoGatewayExists();
GatewayGetResponse response = networkTestClient.Gateways.GetGateway(NetworkTestConstants.VirtualNetworkSiteName);
Assert.NotNull(response);
Assert.Equal("NotProvisioned", response.State);
Assert.Null(response.VipAddress);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:13,代码来源:GetGatewayTests.cs
示例20: ResetStaticRoutingGateway
public void ResetStaticRoutingGateway()
{
using (NetworkTestClient networkTestClient = new NetworkTestClient())
{
networkTestClient.Gateways.EnsureStaticRoutingGatewayExists();
networkTestClient.Gateways.ResetGateway(NetworkTestConstants.VirtualNetworkSiteName, new ResetGatewayParameters());
GatewayGetResponse response = networkTestClient.Gateways.GetGateway(NetworkTestConstants.VirtualNetworkSiteName);
Assert.NotNull(response);
Assert.Equal(GatewayProvisioningEventStates.Provisioned, response.State);
}
}
开发者ID:RossMerr,项目名称:azure-sdk-for-net,代码行数:13,代码来源:ResetGatewayTests.cs
注:本文中的NetworkTestClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论