Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions src/AzSdk.reference.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('AzSdk.props'))" />
<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="[3.3.13, 4.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="[2.3.12, 3.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="[3.3.15, 4.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="[2.3.13, 3.0.0)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
Expand Down
4 changes: 2 additions & 2 deletions src/AzSdk.test.reference.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('test.props'))" />

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Test.HttpRecorder" Version="[1.10.99-Private]" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="[1.7.1,2.0.0)" />
<PackageReference Include="Microsoft.Azure.Test.HttpRecorder" Version="[1.11.0, 2.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="[1.7.3, 2.0.0)" />
<PackageReference Include="Microsoft.Azure.ResourceManager" Version="[1.1.0-preview]" />

<!-- This is needed for discovering tests in test explorer -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<AssemblyName>AnalysisServices.Tests</AssemblyName>
<PackageId>AnalysisServices.Tests</PackageId>
</PropertyGroup>
<!--<PropertyGroup>
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
</PropertyGroup>-->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Management.Analysis\Microsoft.Azure.Management.Analysis.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
<Authors>Microsoft Corporation</Authors>
<AssemblyName>ApiManagementManagement.Tests</AssemblyName>
</PropertyGroup>

<!--<PropertyGroup>
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
</PropertyGroup>-->

<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!--<PackageReference Include="Microsoft.Azure.Management.ApiManagement" Version="2.1.0-ForTest" />-->
<ProjectReference Include="..\Management.ApiManagement\Microsoft.Azure.Management.ApiManagement.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace ApiManagement.Tests.ManagementApiTests
public class ApiExportImportTests : TestBase
{
[Fact]
public async Task SwaggerTest()
public void SwaggerTest()
{
Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -76,7 +76,7 @@ public async Task SwaggerTest()
}

[Fact]
public async Task WadlTest()
public void WadlTest()
{
Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down Expand Up @@ -138,7 +138,7 @@ public async Task WadlTest()
}

[Fact]
public async Task WsdlTest()
public void WsdlTest()
{
Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace ApiManagement.Tests.ManagementApiTests
public class ReportTests : TestBase
{
[Fact]
public async Task Query()
public void Query()
{
Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
using (MockContext context = MockContext.Start(this.GetType().FullName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<Description>Data.ApplicationInsights.Tests Class library</Description>
<PackageId>Data.ApplicationInsights.Tests</PackageId>
<VersionPrefix>1.0.0-preview</VersionPrefix>
<!--<TargetFrameworks>netcoreapp1.1</TargetFrameworks>-->
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description>ApplicationInsights.Tests Class library</Description>
<PackageId>ApplicationInsights.Tests</PackageId>
<VersionPrefix>1.0.0-preview</VersionPrefix>
<!--<TargetFrameworks>netcoreapp1.1</TargetFrameworks>-->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="[1.6.0-preview, 2.0.0)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void CreateGetListUpdateDeleteAPIKeys()
.GetAwaiter()
.GetResult();

Assert.Equal(1, getAllAPIKeys.Body.Count());
Assert.Single(getAllAPIKeys.Body);
AreEqual(apiKeyProperties, getAllAPIKeys.Body.ElementAt(0));

string fullkeyId = getAllAPIKeys.Body.ElementAt(0).Id;
Expand Down Expand Up @@ -85,7 +85,7 @@ public void CreateGetListUpdateDeleteAPIKeys()
.GetResult();

//get API again, should get an NOT found exception
Assert.Throws(typeof(CloudException), () =>
Assert.Throws<CloudException>(() =>
{
getAPIKey = insightsClient
.APIKeys
Expand All @@ -109,12 +109,13 @@ private static void AreEqual(APIKeyRequest request, ApplicationInsightsComponent
Assert.True(response.LinkedWriteProperties.Count >= request.LinkedWriteProperties.Count);
foreach (var readaccess in request.LinkedReadProperties)
{
Assert.True(response.LinkedReadProperties.Any(r => r == readaccess));
Assert.Contains(response.LinkedReadProperties, r => r == readaccess);

}

foreach (var writeaccess in request.LinkedWriteProperties)
{
Assert.True(response.LinkedWriteProperties.Any(w => w == writeaccess));
Assert.Contains(response.LinkedWriteProperties, w => w == writeaccess);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void CreateGetListUpdateDeleteComponents()
.GetResult();

//get component again, should get an exception
Assert.Throws(typeof(CloudException), () =>
Assert.Throws<CloudException>(() =>
{
getComponentResponse = insightsClient
.Components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void CreateGetListUpdateDeleteExports()
createContinuousExportProperties)
.GetAwaiter()
.GetResult();
Assert.Equal(1, createContinuousExportResponse.Body.Count());
Assert.Single(createContinuousExportResponse.Body);
AreEqual(createContinuousExportProperties, createContinuousExportResponse.Body.FirstOrDefault());

//get all continuous exports
Expand All @@ -57,7 +57,7 @@ public void CreateGetListUpdateDeleteExports()
.GetAwaiter()
.GetResult();

Assert.Equal(1, getAllContinuousExports.Body.Count());
Assert.Single(getAllContinuousExports.Body);
AreEqual(createContinuousExportProperties, getAllContinuousExports.Body.FirstOrDefault());

string exportId = getAllContinuousExports.Body.FirstOrDefault().ExportId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected void DeleteAComponent(ApplicationInsightsManagementClient insightsClie
.GetResult();

//get component again, should get an exception
Assert.Throws(typeof(CloudException), () =>
Assert.Throws<CloudException>(() =>
{
var getComponentResponse = insightsClient
.Components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void CreateGetListUpdateDeleteWebtests()
.GetResult();

//get webtest again, should get an exception
Assert.Throws(typeof(CloudException), () =>
Assert.Throws<CloudException>(() =>
{
getWebTestResponse = insightsClient
.WebTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<AssemblyName>Authorization.Tests</AssemblyName>
<PackageId>Authorization.Tests</PackageId>
</PropertyGroup>
<!--<PropertyGroup>
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
</PropertyGroup>-->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public void ClassicAdministratorListTests()
{
Assert.NotNull(classicAdmin);
Assert.NotNull(classicAdmin.Id);
Assert.True(classicAdmin.Id.Contains("/providers/Microsoft.Authorization/classicAdministrators/"));
Assert.True(classicAdmin.Id.Contains("/subscriptions/" + client.SubscriptionId));
Assert.Contains("/providers/Microsoft.Authorization/classicAdministrators/", classicAdmin.Id);
Assert.Contains("/subscriptions/" + client.SubscriptionId, classicAdmin.Id);
Assert.NotNull(classicAdmin.Name);
Assert.NotNull(classicAdmin.Type);
Assert.Equal("Microsoft.Authorization/classicAdministrators", classicAdmin.Type);
Expand Down Expand Up @@ -436,7 +436,7 @@ public void RoleAssignmentPagingTest()
var nextPage = client.RoleAssignments.ListNext(firstPage.NextPageLink);

Assert.NotNull(nextPage);
Assert.NotEqual(0, nextPage.Count());
Assert.NotEmpty(nextPage);

foreach (var roleAssignment in nextPage)
{
Expand Down
6 changes: 3 additions & 3 deletions src/SDKs/Automation/Automation.Tests/Automation.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<Description>Test Project for Automation tests</Description>
</PropertyGroup>

<!--<PropertyGroup>
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
</PropertyGroup>-->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Network" Version="[14.0.0-preview,16.0)" />
Expand Down
2 changes: 1 addition & 1 deletion src/SDKs/Batch/DataPlane/AzSdk.RP.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>BatchService_2018-03-01.6.1;</AzureApiTag>
<AzureApiTag>BatchService_2018-08-01.7.0;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task CanAuthenticateToServiceWithAADToken()
{
Func<Task<string>> tokenProvider = () => IntegrationTestCommon.GetAuthenticationTokenAsync("https://batch.core.windows.net/");

using (var client = await BatchClient.OpenAsync(new BatchTokenCredentials(TestCommon.Configuration.BatchAccountUrl, tokenProvider)))
using (var client = BatchClient.Open(new BatchTokenCredentials(TestCommon.Configuration.BatchAccountUrl, tokenProvider)))
{
await client.JobOperations.ListJobs().ToListAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,6 @@ public async Task Job_GetTaskCounts_ReturnsCorrectCount()
var counts = await unboundJob.GetTaskCountsAsync().ConfigureAwait(false);

Assert.Equal(2, counts.Active);
Assert.Equal(TaskCountValidationStatus.Validated, counts.ValidationStatus);
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ public void TestPoolObjectResizeStopResize()
CloudPool pool = batchCli.PoolOperations.CreatePool(poolId, PoolFixture.VMSize, new CloudServiceConfiguration(PoolFixture.OSFamily), targetDedicatedComputeNodes: targetDedicated);
pool.Commit();

this.testOutputHelper.WriteLine("Created pool {0}", poolId);
this.testOutputHelper.WriteLine($"Created pool {poolId}");


CloudPool boundPool = batchCli.PoolOperations.GetPool(poolId);
Expand All @@ -630,6 +630,7 @@ public void TestPoolObjectResizeStopResize()
boundPool.Refresh();

//The pool could be in stopping or steady state
this.testOutputHelper.WriteLine($"Pool allocation state: {boundPool.AllocationState}");
Assert.True(boundPool.AllocationState == AllocationState.Steady || boundPool.AllocationState == AllocationState.Stopping);
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static BatchSharedKeyCredentials GetCredentialsFromEnvironment()

public static async Task<BatchClient> OpenBatchClientAsync(BatchSharedKeyCredentials sharedKeyCredentials, bool addDefaultRetryPolicy = true)
{
BatchClient client = await BatchClient.OpenAsync(sharedKeyCredentials);
BatchClient client = BatchClient.Open(sharedKeyCredentials);

//Force us to get exception if the server returns something we don't expect
//TODO: To avoid including this test assembly via "InternalsVisibleTo" we resort to some reflection trickery... maybe this property
Expand All @@ -48,10 +48,9 @@ public static async Task<BatchClient> OpenBatchClientAsync(BatchSharedKeyCredent
//TODO: Disabled for now because the swagger spec does not accurately reflect all properties returned by the server
//SetDeserializationSettings(client);

//Set up some common stuff like a retry policy
if (addDefaultRetryPolicy)
if (!addDefaultRetryPolicy)
{
client.CustomBehaviors.Add(RetryPolicyProvider.LinearRetryProvider(TimeSpan.FromSeconds(3), 5));
client.CustomBehaviors = client.CustomBehaviors.Where(behavior => !(behavior is RetryPolicyProvider)).ToList();
}

return client;
Expand Down
Loading