當前位置: 首頁>>代碼示例>>C#>>正文


C# ScenarioTests.ScenarioTestContext類代碼示例

本文整理匯總了C#中Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext的典型用法代碼示例。如果您正苦於以下問題:C# ScenarioTestContext類的具體用法?C# ScenarioTestContext怎麽用?C# ScenarioTestContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ScenarioTestContext類屬於Microsoft.Azure.Commands.Batch.Test.ScenarioTests命名空間,在下文中一共展示了ScenarioTestContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestCancelCertificateDelete

 public void TestCancelCertificateDelete()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string thumbprint = null;
     string poolId = "certPool";
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-TestCancelCertificateDelete '{0}' '{1}'", BatchTestHelpers.TestCertificateAlgorithm, thumbprint) }; },
         () =>
         {
             context = new ScenarioTestContext();
             thumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName);
             CertificateReference certRef = new CertificateReference();
             certRef.StoreLocation = CertStoreLocation.CurrentUser;
             certRef.StoreName = "My";
             certRef.ThumbprintAlgorithm = BatchTestHelpers.TestCertificateAlgorithm;
             certRef.Thumbprint = thumbprint;
             certRef.Visibility = CertificateVisibility.Task;
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId, 0, certRef);
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
             ScenarioTestHelpers.WaitForCertificateToFailDeletion(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId);
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:brnleehng,項目名稱:azure-powershell,代碼行數:30,代碼來源:CertificateTests.cs

示例2: TestListJobSchedulesByFilter

 public void TestListJobSchedulesByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     string jobScheduleId1 = "testId1";
     string jobScheduleId2 = "testId2";
     string jobScheduleId3 = "thirdtestId";
     string jobSchedulePrefix = "testId";
     int matches = 2;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListJobSchedulesByFilter '{0}' '{1}'", jobSchedulePrefix, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId1, null);
             ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId2, null);
             ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId3, null);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId1);
             ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId2);
             ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId3);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:brnleehng,項目名稱:azure-powershell,代碼行數:27,代碼來源:JobScheduleTests.cs

示例3: TestListCertificatesByFilter

 public void TestListCertificatesByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string state = "active";
     string thumbprint1 = null;
     string toDeleteThumbprint = null;
     int matchCount = 1;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListCertificatesByFilter '{0}' '{1}' '{2}'", state, toDeleteThumbprint, matchCount) }; },
         () =>
         {
             context = new ScenarioTestContext();
             thumbprint1 = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName1);
             toDeleteThumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName2);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint1);
             // Other cert is deleted as the first part of the PowerShell test script, but we ensure it's gone.
             try
             {
                 ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, toDeleteThumbprint);
             }
             catch { }
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:29,代碼來源:CertificateTests.cs

示例4: TestUpdateApplicationPackage

        public void TestUpdateApplicationPackage()
        {
            string id = "updateApplicationPackage";

            BatchController controller = BatchController.NewInstance;
            BatchAccountContext context = null;
            controller.RunPsTestWorkflow(
                () =>
                {
                    return new string[]
                    {
                        string.Format(string.Format("Test-UpdateApplicationPackage '{0}' '{1}' '{2}'", id, version, filePath))
                    };
                },
                () =>
                {
                    context = new ScenarioTestContext();
                    ScenarioTestHelpers.CreateApplicationPackage(controller, context, id, version, filePath);
                },
                () =>
                {
                    ScenarioTestHelpers.DeleteApplicationPackage(controller, context, id, version);
                    ScenarioTestHelpers.DeleteApplication(controller, context, id);
                },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
開發者ID:brnleehng,項目名稱:azure-powershell,代碼行數:27,代碼來源:BatchApplicationTests.cs

示例5: TestListPoolsByFilter

 public void TestListPoolsByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     string poolId1 = "testFilter1";
     string poolId2 = "testFilter2";
     string poolId3 = "thirdFilterTest";
     string poolPrefix = "testFilter";
     int matches = 2;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListPoolsByFilter '{0}' '{1}'", poolPrefix, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId1, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId2, 0);
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId3, 0);
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId1);
             ScenarioTestHelpers.DeletePool(controller, context, poolId2);
             ScenarioTestHelpers.DeletePool(controller, context, poolId3);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:brnleehng,項目名稱:azure-powershell,代碼行數:27,代碼來源:PoolTests.cs

示例6: GetBatchAccountContextWithKeys

        /// <summary>
        /// Get Batch Context with keys
        /// </summary>
        public static BatchAccountContext GetBatchAccountContextWithKeys(BatchController controller, string accountName)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);
            BatchAccountContext context = client.ListKeys(null, accountName);

            ScenarioTestContext testContext = new ScenarioTestContext(context);

            return testContext;
        }
開發者ID:kjohn-msft,項目名稱:azure-powershell,代碼行數:12,代碼來源:ScenarioTestHelpers.cs

示例7: TestGetAndListComputeNodesWithSelect

 public void TestGetAndListComputeNodesWithSelect()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string computeNodeId = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetAndListComputeNodesWithSelect '{0}' '{1}'", poolId, computeNodeId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
         },
         null,
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:16,代碼來源:ComputeNodeTests.cs

示例8: TestListComputeNodesByFilter

 public void TestListComputeNodesByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string state = "idle";
     int matches = 0;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListComputeNodesByFilter '{0}' '{1}' '{2}'", poolId, state, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             matches = ScenarioTestHelpers.GetPoolCurrentDedicated(controller, context, poolId);
         },
         null,
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:17,代碼來源:ComputeNodeTests.cs

示例9: TestCreateComputeNodeUserPipeline

        public void TestCreateComputeNodeUserPipeline()
        {
            BatchController controller = BatchController.NewInstance;
            BatchAccountContext context = null;
            string computeNodeId = null;
            string userName = "createuser2";
            controller.RunPsTestWorkflow(
                () => { return new string[] { string.Format("Test-CreateComputeNodeUser '{0}' '{1}' '{2}' 1", poolId, computeNodeId, userName) }; },
                () =>
                {
                    context = new ScenarioTestContext();
                    computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, poolId);
                },
                null,
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());

        }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:18,代碼來源:ComputeNodeUserTests.cs

示例10: TestGetPoolById

 public void TestGetPoolById()
 {
     BatchController controller = BatchController.NewInstance;
     string poolId = "testGetPool";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetPoolById '{0}'", poolId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestPool(controller, context, poolId, 0);
         },
         () =>
         {
             ScenarioTestHelpers.DeletePool(controller, context, poolId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:brnleehng,項目名稱:azure-powershell,代碼行數:19,代碼來源:PoolTests.cs

示例11: TestGetCertificateByThumbprint

 public void TestGetCertificateByThumbprint()
 {
     BatchController controller = BatchController.NewInstance;
     BatchAccountContext context = null;
     string thumbprint = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetCertificateByThumbprint '{0}' '{1}'", BatchTestHelpers.TestCertificateAlgorithm, thumbprint) }; },
         () =>
         {
             context = new ScenarioTestContext();
             thumbprint = ScenarioTestHelpers.AddTestCertificate(controller, context, BatchTestHelpers.TestCertificateFileName1);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteTestCertificate(controller, context, BatchTestHelpers.TestCertificateAlgorithm, thumbprint);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:19,代碼來源:CertificateTests.cs

示例12: TestCreateTaskCollection

 public void TestCreateTaskCollection()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "createTaskCollectionJob";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-CreateTaskCollection '{0}'", jobId) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:Azure,項目名稱:azure-powershell,代碼行數:19,代碼來源:TaskTests.cs

示例13: TestGetNodeFileByTaskByName

 public void TestGetNodeFileByTaskByName()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "testGetNodeFileByTaskJob";
     string taskId = "testTask";
     string nodeFileName = "stdout.txt";
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-GetNodeFileByTaskByName '{0}' '{1}' '{2}'", jobId, taskId, nodeFileName) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId);
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:Azure,項目名稱:azure-powershell,代碼行數:23,代碼來源:FileTests.cs

示例14: TestListNodeFilesByTaskByFilter

 public void TestListNodeFilesByTaskByFilter()
 {
     BatchController controller = BatchController.NewInstance;
     string jobId = "listNodeFileByTaskFilterJob";
     string taskId = "testTask";
     string nodeFilePrefix = "std";
     int matches = 2;
     BatchAccountContext context = null;
     controller.RunPsTestWorkflow(
         () => { return new string[] { string.Format("Test-ListNodeFilesByTaskByFilter '{0}' '{1}' '{2}' '{3}'", jobId, taskId, nodeFilePrefix, matches) }; },
         () =>
         {
             context = new ScenarioTestContext();
             ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
             ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId);
             ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
         },
         () =>
         {
             ScenarioTestHelpers.DeleteJob(controller, context, jobId);
         },
         TestUtilities.GetCallingClass(),
         TestUtilities.GetCurrentMethodName());
 }
開發者ID:Azure,項目名稱:azure-powershell,代碼行數:24,代碼來源:FileTests.cs

示例15: TestGetComputeNodeRemoteLoginSettings

        private void TestGetComputeNodeRemoteLoginSettings(bool usePipeline, string testMethodName)
        {
            BatchController controller = BatchController.NewInstance;
            BatchAccountContext context = null;
            string computeNodeId = null;

            controller.RunPsTestWorkflow(
                () => { return new string[] { string.Format("Test-GetRemoteLoginSettings '{0}' '{1}' '{2}'", iaasPoolId, computeNodeId, usePipeline ? 1 : 0) }; },
                () =>
                {
                    context = new ScenarioTestContext();
                    computeNodeId = ScenarioTestHelpers.GetComputeNodeId(controller, context, iaasPoolId);
                },
                null,
                TestUtilities.GetCallingClass(),
                testMethodName);
        }
開發者ID:FrankSiegemund,項目名稱:azure-powershell,代碼行數:17,代碼來源:ComputeNodeTests.cs


注:本文中的Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。