TFS - 将 运行 ID 链接到测试 ID?

TFS - linking Run ID to Test ID?

TFS 网站: 我分配了所有测试人员来测试特定的套件/测试用例。

我正在寻找创建统计/查询以将 运行 ID 与其测试用例 ID 相关联的可能性。

这可能吗?

没有这样的查询将 运行 ID 关联到它们的测试用例 ID,但您可以通过 API 实现。

下面是一个从测试用例ID中获取第一个测试运行 ID的例子,大家可以参考:

TfsTeamProjectCollection tfsCollection = new TfsTeamProjectCollection(new Uri("http://tfsserver:8080/tfs/teamProjectCollection"));
ITestManagementService tms = tfsCollection.GetService<ITestManagementService>();
ITestManagementTeamProject teamProject = tms.GetTeamProject("teamproject");
var lastResult = teamProject.TestResults.ByTestId(tc.Id).OrderByDescending(tr => tr.DateStarted).FirstOrDefault();
var run= lastResult.GetTestRun();
Console.WriteLine(run.Id);