Skip to content

Commit

Permalink
Merge pull request Azure#110 from Azure/master
Browse files Browse the repository at this point in the history
.
  • Loading branch information
huangpf committed Oct 2, 2015
2 parents e5ac175 + 96ec8a4 commit f7792ce
Show file tree
Hide file tree
Showing 28 changed files with 252 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Compile Include="Helpers\ResourcesManagementTestUtilities.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tests\ApplicationGatewayTests.cs" />
<Compile Include="Tests\ExpressRouteServiceProviderTests.cs" />
<Compile Include="Tests\ExpressRouteCircuitTests.cs" />
<Compile Include="Tests\GatewayOperationsTests.cs" />
<Compile Include="Tests\RouteTest.cs" />
Expand Down Expand Up @@ -56,6 +57,9 @@
<None Include="SessionRecords\Networks.Tests.ExpressRouteCircuitTests\ExpressRouteCircuitWithPeeringApiTest.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Networks.Tests.ExpressRouteServiceProviderTests\ExpressRouteServiceProviderTest.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Networks.Tests.LoadBalancerTests\CreateEmptyLoadBalancer.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"Entries": [
{
"RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/expressRouteServiceProviders?api-version=2015-05-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9leHByZXNzUm91dGVTZXJ2aWNlUHJvdmlkZXJzP2FwaS12ZXJzaW9uPTIwMTUtMDUtMDEtcHJldmlldw==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Management.Network.NetworkResourceProviderClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"Equinix\",\r\n \"id\": \"/subscriptions//resourceGroups//providers/Microsoft.Network/expressRouteServiceProviders/\",\r\n \"type\": \"Microsoft.Network/expressRouteServiceProviders\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringLocations\": [\r\n \"Amsterdam\",\r\n \"Atlanta\",\r\n \"Chicago\",\r\n \"Dallas\",\r\n \"Hong Kong\",\r\n \"London\",\r\n \"Los Angeles\",\r\n \"Melbourne\",\r\n \"New York\",\r\n \"Sao Paulo\",\r\n \"Seattle\",\r\n \"Silicon Valley\",\r\n \"Singapore\",\r\n \"Sydney\",\r\n \"Tokyo\",\r\n \"Washington DC\"\r\n ],\r\n \"bandwidthsOffered\": [\r\n {\r\n \"offerName\": \"200Mbps\",\r\n \"valueInMbps\": 200\r\n },\r\n {\r\n \"offerName\": \"500Mbps\",\r\n \"valueInMbps\": 500\r\n },\r\n {\r\n \"offerName\": \"1Gbps\",\r\n \"valueInMbps\": 1000\r\n },\r\n {\r\n \"offerName\": \"10Gbps\",\r\n \"valueInMbps\": 10000\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"1152"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-request-id": [
"b3da87ca-19e8-4cbf-854d-770116e1e401"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Server": [
"Microsoft-HTTPAPI/2.0",
"Microsoft-HTTPAPI/2.0"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14969"
],
"x-ms-correlation-request-id": [
"df7ab8a4-1cd8-4689-b2e3-3ec79eb0b4c4"
],
"x-ms-routing-request-id": [
"WESTUS:20151002T061407Z:df7ab8a4-1cd8-4689-b2e3-3ec79eb0b4c4"
],
"Date": [
"Fri, 02 Oct 2015 06:14:07 GMT"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "9532a63e-f2eb-4649-bb23-5ed01077ce80"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

namespace Networks.Tests
{
using System.Linq;
using System.Net;
using Microsoft.Azure.Test;
using Networks.Tests.Helpers;
using ResourceGroups.Tests;
using Xunit;
using Microsoft.Azure.Management.Network;

public class ExpressRouteServiceProviderTests
{
[Fact]
public void ExpressRouteServiceProviderTest()
{
var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK };

using (var context = UndoContext.Current)
{
context.Start();
var networkResourceProviderClient = NetworkManagementTestUtilities.GetNetworkResourceProviderClient(handler);

var listServiceProviders = networkResourceProviderClient.ExpressRouteServiceProviders.List();

// Verify properties
Assert.Equal(HttpStatusCode.OK, listServiceProviders.StatusCode);

Assert.True(listServiceProviders.ExpressRouteServiceProviders.Any());
Assert.True(listServiceProviders.ExpressRouteServiceProviders[0].PeeringLocations.Any());
Assert.True(listServiceProviders.ExpressRouteServiceProviders[0].BandwidthsOffered.Any());
Assert.NotNull(listServiceProviders.ExpressRouteServiceProviders[0].Name);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,7 @@ public async Task<AzureAsyncOperationResponse> CreateOrUpdateAsync(string resour
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -2145,7 +2145,7 @@ public async Task<AzureOperationResponse> DeleteAsync(string resourceGroupName,
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -4744,7 +4744,7 @@ public async Task<AzureAsyncOperationResponse> StartAsync(string resourceGroupNa
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -4820,7 +4820,7 @@ public async Task<AzureAsyncOperationResponse> StopAsync(string resourceGroupNam
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ public async Task<AzureAsyncOperationResponse> CreateOrUpdateAsync(string resour
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -711,7 +711,7 @@ public async Task<AzureOperationResponse> DeleteAsync(string resourceGroupName,
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ public async Task<AzureAsyncOperationResponse> CreateOrUpdateAsync(string resour
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -1237,7 +1237,7 @@ public async Task<AzureOperationResponse> DeleteAsync(string resourceGroupName,
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ public async Task<AzureAsyncOperationResponse> CreateOrUpdateAsync(string resour
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -898,7 +898,7 @@ public async Task<AzureOperationResponse> DeleteAsync(string resourceGroupName,
{
delayInSeconds = client.LongRunningOperationInitialTimeout;
}
while ((result.Status != Microsoft.Azure.Management.Network.Models.OperationStatus.InProgress) == false)
while (result.Status == NetworkOperationStatus.InProgress)
{
cancellationToken.ThrowIfCancellationRequested();
await TaskEx.Delay(delayInSeconds * 1000, cancellationToken).ConfigureAwait(false);
Expand Down
Loading

0 comments on commit f7792ce

Please sign in to comment.