TFS 2012 API获取字段摘要对象测试用例



SUMMARY获得TestCase对象中的字段,我获得检索步骤和预期结果的代码,没有SUMMARY。请帮忙。

谢谢

         for (int i = 0; i < testPlan.TestSuites.Count; i++)
            {
                var ts = testPlan.TestSuites[i];
                ITestSuiteEntryCollection suiteentrys = ts.TestCases;
                foreach (ITestSuiteEntry item in suiteentrys)
                {
                    ITestCase tes = item.TestCase;
                    tfsTestCase testcase = new tfsTestCase();
                    testcase.Suite = testPlan.TestSuites[i].Title;
                    testcase.Nombre = tes.Title;
                    foreach (ITestAction action in tes.Actions)
                    {
                        ITestStep er = action as ITestStep;
                        testcase.NumeroPaso = er.Id;
                        testcase.Paso = er.Title;
                        testcase.ResultadoEsperado = er.ExpectedResult;
                        testcase.Descripcion = er.Summary ??? ;
                    }
                    lsttestcase.Add(testcase); 
                }
              }
            }

test-步骤没有摘要。测试-用例由测试步骤组成,并且是测试用例具有摘要。

你可以试试

testCase.CustomFields("摘要");

最新更新