我正在使用 Rally soap API 针对之前创建的测试用例创建一个新的 TestCaseResult。但是当我创建结果时出现错误 - “验证错误:TestCaseResult.Date 不应为空”
不知道为什么会这样——你能帮忙吗?
private Boolean createTestResultForTest(String aResult, String aTestCase)
{
TestCaseResult myTestCaseResult = new TestCaseResult();
myTestCaseResult.Build = "1";
DateTime myDate = DateTime.Now;
myTestCaseResult.Date = myDate;
String myQuery = "(FormattedID = " + aTestCase + ")";
QueryResult myTestCaseReturn = m_rallyService.query(m_workspace, "TestCase", myQuery, "", true, 0, 100);
long mycount = myTestCaseReturn.TotalResultCount;
if (mycount > 0)
{
TestCase myTestCase = (TestCase)myTestCaseReturn.Results[0];
myTestCaseResult.TestCase = myTestCase;
}
else
{
return false;
}
myTestCaseResult.Verdict = aResult;
CreateResult myCreateTestResultResult = m_rallyService.create(myTestCaseResult);
if (hasErrors(myCreateTestResultResult))
{
updateStatus("Could not create test result for test case:" + myTestCaseResult.TestCase.Name);
printWarningsErrors(myCreateTestResultResult);
return false;
}
else
{
myTestCaseResult = (TestCaseResult)myCreateTestResultResult.Object;
myTestCaseResult = (TestCaseResult)m_rallyService.read(myTestCaseResult);
updateStatus("Created TestCaseResult: " + myTestCaseResult.TestCase.Name + ", ref = " + myTestCaseResult.@ref);
}
return true;
}