|
1 | | -using System.Collections.Generic; |
| 1 | +// ---------------------------------------------------------------------------------- |
| 2 | +// |
| 3 | +// Copyright Microsoft Corporation |
| 4 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// you may not use this file except in compliance with the License. |
| 6 | +// You may obtain a copy of the License at |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// Unless required by applicable law or agreed to in writing, software |
| 9 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +// See the License for the specific language governing permissions and |
| 12 | +// limitations under the License. |
| 13 | +// ---------------------------------------------------------------------------------- |
| 14 | + |
| 15 | +using System; |
| 16 | +using System.Collections.Generic; |
2 | 17 | using System.Linq; |
3 | 18 | using System.Net.Http; |
4 | 19 | using System.Net.Http.Headers; |
|
10 | 25 | using Microsoft.Azure.Test.HttpRecorder; |
11 | 26 | using Microsoft.Rest; |
12 | 27 | using Microsoft.Rest.ClientRuntime.Azure.TestFramework; |
13 | | -using Microsoft.WindowsAzure.Commands.ScenarioTest; |
14 | 28 | using Xunit.Abstractions; |
15 | 29 |
|
16 | 30 | namespace Microsoft.Azure.Commands.Resources.Test.ScenarioTests |
@@ -43,10 +57,13 @@ protected TestManagerBuilder(ITestOutputHelper output) |
43 | 57 | .Build(); |
44 | 58 |
|
45 | 59 | var testEnvironment = TestEnvironmentFactory.GetTestEnvironment(); |
46 | | - |
47 | | - var credentials = new SubscriptionCloudCredentialsAdapter( |
48 | | - testEnvironment.TokenInfo[TokenAudience.Management], |
49 | | - testEnvironment.SubscriptionId); |
| 60 | + var credentials = HttpMockServer.Mode == HttpRecorderMode.Record |
| 61 | + ? new SubscriptionCloudCredentialsAdapter( |
| 62 | + testEnvironment.TokenInfo[TokenAudience.Management], |
| 63 | + testEnvironment.SubscriptionId) |
| 64 | + : new SubscriptionCloudCredentialsAdapter( |
| 65 | + new TokenCredentials("foo"), |
| 66 | + Guid.Empty.ToString()); |
50 | 67 |
|
51 | 68 | HttpClientHelperFactory.Instance = new TestHttpClientHelperFactory(credentials); |
52 | 69 | } |
|
0 commit comments