Beispiel #1
0
        public void RunPowerShellTest(ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts)
        {
            var sf = new StackTrace().GetFrame(1);
            var callingClassType = sf.GetMethod().ReflectedType?.ToString();
            var mockName         = sf.GetMethod().Name;

            _helper.TracingInterceptor = logger;
            var providers         = new Dictionary <string, string>();
            var providersToIgnore = new Dictionary <string, string>();

            HttpMockServer.Matcher          = new PermissiveRecordMatcherWithApiExclusion(true, providers, providersToIgnore);
            HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");

            using (var context = MockContext.Start(callingClassType, mockName))
            {
                SetupManagementClients(context);

                _helper.SetupEnvironment(AzureModule.AzureResourceManager);

                var callingClassName = callingClassType?.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries).Last();
                _helper.SetupModules(
                    AzureModule.AzureResourceManager,
                    _helper.RMProfileModule,
                    _helper.GetRMModulePath(@"AzureRM.Security.psd1"),
                    "ScenarioTests\\Common.ps1",
                    "ScenarioTests\\" + callingClassName + ".ps1");

                _helper.RunPowerShellTest(scripts);
            }
        }
Beispiel #2
0
        public void RunPowerShellTest(ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts)
        {
            var callingClassType = TestUtilities.GetCallingClass(2);
            var mockName         = TestUtilities.GetCurrentMethodName(2);

            _helper.TracingInterceptor = logger;
            RunPsTestWorkflow(
                scriptBuilder: () => scripts,
                initialize: null,
                cleanup: null,
                callingClassType: callingClassType,
                mockName: mockName);
        }
        public void RunPowerShellTest(ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts)
        {
            var sf = new StackTrace().GetFrame(1);
            var callingClassType = sf.GetMethod().ReflectedType?.ToString();
            var mockName         = sf.GetMethod().Name;

            _helper.TracingInterceptor = logger;
            RunPsTestWorkflow(
                () => scripts,
                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
        public void RunPsTest(ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts)
        {
            var callingClassType = TestUtilities.GetCallingClass(2);
            var mockName         = TestUtilities.GetCurrentMethodName(2);

            helper.TracingInterceptor = logger;
            RunPsTestWorkflow(
                () => scripts,
                // no custom initializer
                null,
                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
 public EndpointTests(Xunit.Abstractions.ITestOutputHelper output)
 {
     _logger = new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output);
     ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
 }
 public EnrollmentAccountTests(Xunit.Abstractions.ITestOutputHelper output)
 {
     _logger = new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output);
     ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
     TestExecutionHelpers.SetUpSessionAndProfile();
 }
 public SqlIaaSExtensionTests(Xunit.Abstractions.ITestOutputHelper output)
 {
     _logger = new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output);
     ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
 }
 public WebApplicationFireWallPolicyTests(Xunit.Abstractions.ITestOutputHelper output)
 {
     _logger = new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output);
     ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
 }