1
TFS/MTM에서 테스트 케이스를 전달하는 코드는 다음과 같습니다. 테스트 케이스를 외부에서 전달하려고했지만 테스트 케이스의 내부 단계를 확인하면됩니다. 테스트 케이스의 각 액션을 통과시켜 테스트 케이스를 전달하려고합니다. 도움을 청하니 .tfs api를 사용하여 tfs의 테스트 케이스 전달
ITestPlan tp = testinsuitesd.Plan;
// foreach (ITestCase testcase in allTestCases)
//{
ITestRun testRun = testinsuitesd.Plan.CreateTestRun(false);
ITestPointCollection testPoints = tp.QueryTestPoints("select * from TestPoint where suiteId= "+ testinsuitesd.Id);
foreach(ITestPoint testRuns in testPoints)
{
testRun.AddTestPoint(testRuns, null);
}
testRun.Save();
ITestCaseResultCollection testCaseResult = testRun.QueryResults(); //code to Pass the test Case
foreach (ITestCaseResult testResult in testCaseResult)
{
ITestIterationResult iterationResult;
ITestActionResult actionResults;
iterationResult = testResult.CreateIteration(1);
//actionResults = testResult.CreateIteration(1);
foreach (ITestAction testStep in testResult.GetTestCase().Actions)
{
ITestActionResult stepResult = iterationResult.CreateStepResult(testStep.Id);
//stepResult.ErrorMessage = String.Empty;
stepResult.Outcome = TestOutcome.Passed; //you can assign different states here
iterationResult.Actions.Add(stepResult);
//actionResults.Add(stepResult);
// iterationResult.Actions.Add(stepResult);
// actionResults. Add(stepResult);
}
iterationResult.Outcome = TestOutcome.Passed;
testResult.Iterations.Add(iterationResult);
testResult.Outcome = TestOutcome.Passed;
testResult.State = TestResultState.Completed;
testResult.Save();
}
testCaseResult.Save(false);
// testCaseResult.
testRun.Save();
testRun.Refresh();
tp.Save();
안녕 "_testEditInfo"위의 사용 목적은 당신이 알려 주시기 바랍니다 수 있습니까? 타입이다 뭐죠 내 코드의 문제. –