Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ItemGroup>
<!--<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="0.3.0-preview" />-->
<ProjectReference Include="..\Management.CognitiveServices\Microsoft.Azure.Management.CognitiveServices.csproj" />
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" />

<PackageReference Include="System.Runtime" Version="4.3.0" />
</ItemGroup>
Expand All @@ -27,4 +28,5 @@
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Azure;
using Microsoft.Azure.Management.Resources;
using Microsoft.Azure.Management.Resources.Models;
using Microsoft.Azure.Management.CognitiveServices;
using Microsoft.Azure.Management.CognitiveServices.Models;
using Microsoft.Azure.Management.ResourceManager;
using Microsoft.Azure.Management.ResourceManager.Models;
using Microsoft.Rest;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using ResourceGroups.Tests;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using Xunit;

namespace CognitiveServices.Tests.Helpers
Expand All @@ -25,11 +20,6 @@ public static class CognitiveServicesManagementTestUtilities
public static bool IsTestTenant = false;
private static HttpClientHandler Handler = null;

// These should be filled in only if test tenant is true
#if DNX451
private static string certName = null;
private static string certPassword = null;
#endif
private const string testSubscription = null;
private static Uri testUri = null;

Expand Down Expand Up @@ -76,16 +66,6 @@ public static CognitiveServicesManagementClient GetCognitiveServicesManagementCl

private static HttpClientHandler GetHandler()
{
#if DNX451
if (Handler == null)
{
//talk to yugangw-msft, if the code doesn't work under dnx451 (same with net451)
X509Certificate2 cert = new X509Certificate2(certName, certPassword);
Handler = new System.Net.Http.WebRequestHandler();
((WebRequestHandler)Handler).ClientCertificates.Add(cert);
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; };
}
#endif
return Handler;
}

Expand All @@ -95,7 +75,7 @@ public static CognitiveServicesAccountCreateParameters GetDefaultCognitiveServic
{
Location = DefaultLocation,
Tags = DefaultTags,
Sku = new Sku { Name = DefaultSkuName },
Sku = new Microsoft.Azure.Management.CognitiveServices.Models.Sku { Name = DefaultSkuName },
Kind = DefaultKind,
Properties = new object(),
};
Expand Down Expand Up @@ -137,7 +117,7 @@ public static CognitiveServicesAccount CreateAndValidateAccountWithOnlyRequiredP
var accountName = TestUtilities.GenerateName("csa");
var parameters = new CognitiveServicesAccountCreateParameters
{
Sku = new Sku { Name = skuName },
Sku = new Microsoft.Azure.Management.CognitiveServices.Models.Sku { Name = skuName },
Kind = accountType,
Location = location ?? DefaultLocation,
Properties = new object(),
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading