|
| 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 Microsoft.Azure.Internal.Common; |
| 16 | +using Microsoft.Azure.Management.Batch; |
| 17 | +using Microsoft.Azure.Management.Internal.Resources; |
| 18 | +using Microsoft.Azure.Management.Network; |
| 19 | +using Microsoft.Azure.Test.HttpRecorder; |
| 20 | +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; |
| 21 | +using System; |
| 22 | +using System.Collections.Generic; |
| 23 | +using Microsoft.Azure.Commands.TestFx; |
| 24 | +using Xunit.Abstractions; |
| 25 | + |
| 26 | +namespace Microsoft.Azure.Commands.Batch.Test.ScenarioTests |
| 27 | +{ |
| 28 | + // Needs more initialize parameters after setup HttpMockServer. |
| 29 | + public class BatchTestRunner |
| 30 | + { |
| 31 | + protected readonly ITestRunner TestRunner; |
| 32 | + |
| 33 | + protected BatchTestRunner(ITestOutputHelper output) |
| 34 | + { |
| 35 | + TestRunner = TestManager.CreateInstance(output) |
| 36 | + .WithNewPsScriptFilename($"{GetType().Name}.ps1") |
| 37 | + .WithProjectSubfolderForTests("ScenarioTests") |
| 38 | + .WithCommonPsScripts(new[] |
| 39 | + { |
| 40 | + @"Common.ps1", |
| 41 | + @"../AzureRM.Resources.ps1", |
| 42 | + }) |
| 43 | + .WithNewRmModules(helper => new[] |
| 44 | + { |
| 45 | + helper.RMProfileModule, |
| 46 | + helper.GetRMModulePath("Az.Batch.psd1"), |
| 47 | + helper.GetRMModulePath("Az.Network.psd1") |
| 48 | + }) |
| 49 | + .WithNewRecordMatcherArguments( |
| 50 | + userAgentsToIgnore: new Dictionary<string, string> |
| 51 | + { |
| 52 | + {"Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01"}, |
| 53 | + }, |
| 54 | + resourceProviders: new Dictionary<string, string> |
| 55 | + { |
| 56 | + {"Microsoft.Resources", null}, |
| 57 | + {"Microsoft.Features", null}, |
| 58 | + {"Microsoft.Network", null}, |
| 59 | + {"Microsoft.Authorization", null} |
| 60 | + } |
| 61 | + ) |
| 62 | + .Build(); |
| 63 | + } |
| 64 | + } |
| 65 | +} |
0 commit comments