public void AddCoverageEx(SubjectNode subNode, Req theReqToCover) { try { /* Add all tests under a subject folder to the requirement coverage Get a List of all the covering tests that have not run */ int subjectID; TDFilter testFilter; List covList; subjectID = subNode.NodeID; Debug.Print(subjectID.ToString()); // Create the coverage theReqToCover.AddCoverageEx(subjectID, (int)tagTDAPI_POS_ORDER.TDPOSITION_LAST); theReqToCover.Post(); testFilter = ((TestFactory)tdConnection.TestFactory).Filter; testFilter["TS_EXEC_STATUS"] = "\"No Run\""; covList = theReqToCover.GetCoverListByFilter(testFilter.Text, true); foreach (ITest aTest in covList) { Debug.WriteLine(aTest.Name + aTest.ExecStatus + aTest.Type); } } catch (Exception ex) { //AddCoverageExErr: Debug.WriteLine(ex.ToString()); } } |