Ejemplo n.º 1
0
        protected void RunPowerShellTest(XunitTracingInterceptor logger, params string[] scripts)
        {
            helper.TracingInterceptor = logger;
            var callingClassType          = TestUtilities.GetCallingClass(2);
            var mockName                  = TestUtilities.GetCurrentMethodName(2);
            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("Microsoft.Resources", null);
            d.Add("Microsoft.Features", null);
            d.Add("Microsoft.Authorization", null);
            var providersToIgnore = new Dictionary <string, string>();

            providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
            HttpMockServer.Matcher          = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
            HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");

            using (MockContext context = MockContext.Start(callingClassType, mockName))
            {
                SetupManagementClients(context);
                var whatisthis = this.GetType().Name;

                helper.SetupEnvironment(AzureModule.AzureResourceManager);
                helper.SetupModules(AzureModule.AzureResourceManager,
                                    "ScenarioTests\\" + this.GetType().Name + ".ps1",
                                    helper.RMProfileModule,
                                    helper.GetRMModulePath(@"AzureRM.StreamAnalytics.psd1"));

                helper.RunPowerShellTest(scripts);
            }
        }
Ejemplo n.º 2
0
        public void RunPowerShellTest(params string[] scripts)
        {
            var callingClassType = TestUtilities.GetCallingClass(2);
            var mockName         = TestUtilities.GetCurrentMethodName(2);

            HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");
            using (MockContext context = MockContext.Start(callingClassType, mockName))
            {
                this.csmTestFactory = new LegacyTest.CSMTestEnvironmentFactory();
                SetupManagementClients(context);

                var callingClassName = callingClassType
                                       .Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries)
                                       .Last();
                helper.SetupEnvironment(AzureModule.AzureResourceManager);
                helper.SetupModules(AzureModule.AzureResourceManager,
                                    "ScenarioTests\\" + callingClassName + ".ps1",
                                    helper.RMProfileModule,
                                    helper.RMResourceModule,
                                    helper.GetRMModulePath(@"AzureRM.RedisCache.psd1"));

                if (scripts != null)
                {
                    helper.RunPowerShellTest(scripts);
                }
            }
        }
Ejemplo n.º 3
0
        public void RunPsTest(params string[] scripts)
        {
            var callingClassType = TestUtilities.GetCallingClass(2);
            var mockName         = TestUtilities.GetCurrentMethodName(2);

            RunPsTestWorkflow(
                () => scripts,
                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
Ejemplo n.º 4
0
        public void RunPsTest(bool createWasbAccount, params string[] scripts)
        {
            var callingClassType = TestUtilities.GetCallingClass(2);
            var mockName         = TestUtilities.GetCurrentMethodName(2);

            RunPsTestWorkflow(createWasbAccount,
                              () => scripts,
                              // no custom initializer
                              null,
                              // no custom cleanup
                              null,
                              callingClassType,
                              mockName);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        public void RunPsTest(params string[] scripts)
        {
            TestExecutionHelpers.SetUpSessionAndProfile();
            var callingClassType = TestUtilities.GetCallingClass(2);
            var mockName         = TestUtilities.GetCurrentMethodName(2);

            RunPsTestWorkflow(
                () => scripts,
                // no custom initializer
                null,
                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
Ejemplo n.º 7
0
        public void RunPowerShellTest(params string[] scripts)
        {
            string callingClassType = TestUtilities.GetCallingClass(2);
            string mockName         = TestUtilities.GetCurrentMethodName(2);


            this.RunPsTestWorkflow(
                () => scripts,
                // no custom initializer
                null,
                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
Ejemplo n.º 8
0
        public void RunPowerShellTest(XunitTracingInterceptor logger, params string[] scripts)
        {
            string callingClassType = TestUtilities.GetCallingClass(2);
            string mockName         = TestUtilities.GetCurrentMethodName(2);

            helper.TracingInterceptor = logger;

            this.RunPsTestWorkflow(
                () => scripts,
                // no custom initializer
                null,
                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
Ejemplo n.º 9
0
        public void RunPowerShellTest(params string[] scripts)
        {
            var callingClassType = TestUtilities.GetCallingClass(2);
            var mockName         = TestUtilities.GetCurrentMethodName(2);

            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("Microsoft.Resources", null);
            d.Add("Microsoft.Features", null);
            d.Add("Microsoft.Authorization", null);
            var providersToIgnore = new Dictionary <string, string>();

            providersToIgnore.Add("Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient", "2016-02-01");
            HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);

            HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");
            using (MockContext context = MockContext.Start(callingClassType, mockName))
            {
                this.csmTestFactory = new LegacyTest.CSMTestEnvironmentFactory();
                SetupManagementClients(context);

                var callingClassName = callingClassType
                                       .Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries)
                                       .Last();
                helper.SetupEnvironment(AzureModule.AzureResourceManager);
                helper.SetupModules(AzureModule.AzureResourceManager,
                                    "ScenarioTests\\" + callingClassName + ".ps1",
                                    helper.RMProfileModule,
                                    helper.RMResourceModule,
                                    helper.RMStorageDataPlaneModule,
                                    "AzureRM.Storage.ps1",
                                    helper.GetRMModulePath(@"AzureRM.RedisCache.psd1"),
                                    "AzureRM.Resources.ps1");

                if (scripts != null)
                {
                    helper.RunPowerShellTest(scripts);
                }
            }
        }