本文整理汇总了C#中Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext类的典型用法代码示例。如果您正苦于以下问题:C# ScenarioTestContext类的具体用法?C# ScenarioTestContext怎么用?C# ScenarioTestContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScenarioTestContext类属于Microsoft.Azure.Commands.Batch.Test.ScenarioTests命名空间,在下文中一共展示了ScenarioTestContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: TestChangeOSVersion
private void TestChangeOSVersion(bool usePipeline)
{
BatchController controller = BatchController.NewInstance;
BatchAccountContext context = null;
string newTargetOSVersion = null;
controller.RunPsTestWorkflow(
() => { return new string[] { string.Format("Test-ChangeOSVersion '{0}' '{1}' '{2}'", testPoolId, newTargetOSVersion, usePipeline ? 1 : 0) }; },
() =>
{
context = new ScenarioTestContext();
string currentTargetOSVersion = ScenarioTestHelpers.WaitForOSVersionChange(controller, context, testPoolId);
newTargetOSVersion = currentTargetOSVersion == "*" ? specificOSVersion : "*";
},
null,
TestUtilities.GetCallingClass(),
usePipeline ? "TestChangeOSVersionPipeline" : "TestChangeOSVersionById");
}
开发者ID:brnleehng,项目名称:azure-powershell,代码行数:17,代码来源:PoolTests.cs
示例17: TestListNodeFilesByTaskRecursive
public void TestListNodeFilesByTaskRecursive()
{
BatchController controller = BatchController.NewInstance;
string jobId = "listNodeFileByTaskRecursiveJob";
string taskId = "testTask";
string newFile = "testFile.txt";
BatchAccountContext context = null;
controller.RunPsTestWorkflow(
() => { return new string[] { string.Format("Test-ListNodeFilesByTaskRecursive '{0}' '{1}' '{2}'", jobId, taskId, newFile) }; },
() =>
{
context = new ScenarioTestContext();
ScenarioTestHelpers.CreateTestJob(controller, context, jobId);
ScenarioTestHelpers.CreateTestTask(controller, context, jobId, taskId, string.Format("cmd /c echo \"test file\" > {0}", newFile));
ScenarioTestHelpers.WaitForTaskCompletion(controller, context, jobId, taskId);
},
() =>
{
ScenarioTestHelpers.DeleteJob(controller, context, jobId);
},
TestUtilities.GetCallingClass(),
TestUtilities.GetCurrentMethodName());
}
开发者ID:Azure,项目名称:azure-powershell,代码行数:23,代码来源:FileTests.cs
示例18: TestEvaluateAutoScaleByPipeline
public void TestEvaluateAutoScaleByPipeline()
{
BatchController controller = BatchController.NewInstance;
BatchAccountContext context = null;
controller.RunPsTestWorkflow(
() => { return new string[] { string.Format("Test-EvaluateAutoScale '{0}' '1'", testPoolId) }; },
() =>
{
context = new ScenarioTestContext();
ScenarioTestHelpers.EnableAutoScale(controller, context, testPoolId);
ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
},
() =>
{
ScenarioTestHelpers.DisableAutoScale(controller, context, testPoolId);
},
TestUtilities.GetCallingClass(),
TestUtilities.GetCurrentMethodName());
}
开发者ID:brnleehng,项目名称:azure-powershell,代码行数:19,代码来源:PoolTests.cs
示例19: TestStopResizePoolById
public void TestStopResizePoolById()
{
BatchController controller = BatchController.NewInstance;
BatchAccountContext context = null;
controller.RunPsTestWorkflow(
() => { return new string[] { string.Format("Test-StopResizePoolById '{0}'", testPoolId) }; },
() =>
{
context = new ScenarioTestContext();
ScenarioTestHelpers.WaitForSteadyPoolAllocation(controller, context, testPoolId);
},
null,
TestUtilities.GetCallingClass(),
TestUtilities.GetCurrentMethodName());
}
开发者ID:brnleehng,项目名称:azure-powershell,代码行数:15,代码来源:PoolTests.cs
示例20: TestListAllPools
public void TestListAllPools()
{
BatchController controller = BatchController.NewInstance;
string poolId1 = "testList1";
string poolId2 = "testList2";
string poolId3 = "thirdTestList";
int beforeAddCount = 0;
int afterAddCount = 0;
BatchAccountContext context = null;
controller.RunPsTestWorkflow(
() => { return new string[] { string.Format("Test-ListAllPools '{0}'", afterAddCount) }; },
() =>
{
context = new ScenarioTestContext();
beforeAddCount = ScenarioTestHelpers.GetPoolCount(controller, context);
ScenarioTestHelpers.CreateTestPool(controller, context, poolId1, 0);
ScenarioTestHelpers.CreateTestPool(controller, context, poolId2, 0);
ScenarioTestHelpers.CreateTestPool(controller, context, poolId3, 0);
afterAddCount = beforeAddCount + 3;
},
() =>
{
ScenarioTestHelpers.DeletePool(controller, context, poolId1);
ScenarioTestHelpers.DeletePool(controller, context, poolId2);
ScenarioTestHelpers.DeletePool(controller, context, poolId3);
},
TestUtilities.GetCallingClass(),
TestUtilities.GetCurrentMethodName());
}
开发者ID:brnleehng,项目名称:azure-powershell,代码行数:29,代码来源:PoolTests.cs
注:本文中的Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论