1
假设我有一个像这样如何找到一个给定ITestCase对象的所有共享步骤引用在TFS
ITestCase tc = project.TestCases.Find(2034);
凡project
是
TfsTeamProjectCollection tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(tfsLocation));
ITestManagementService testService = tfs.GetService<ITestManagementService>();
return testService.GetTeamProject(projectName);
获得
ITestManagementTeamProject
类型的对象获得
ITestCase
对象
考虑到我没有关于该测试用例的任何先前状态知识,我该如何获得该特定测试用例的所有共享步骤引用(甚至不知道是否有其中一个)。
请帮忙。
真棒。谢谢。最后一个问题是,如果我需要删除共享步骤引用,那么删除该测试用例的所有操作是否可以完成这项工作? –
@SohamDasgupta是的,你可以使用'TestCase.Actions.Remove(xx)'来做到这一点。以下是一些代码示例的相关主题:https://social.msdn.microsoft.com/Forums/vstudio/en-US/426b46f0-6a73-4f09-bc7a-83243e803c57/problem-using-the-ite-casestatlectionremove-function?论坛= vsmantest –