public List<TestPlan> GetProjectTestPlans(int projectid)
{
List<TestPlan> retval = new List<TestPlan>();
object response = null;
stateIsValid();
// Checked Testlink V 1.9.2 Still behaves this way
try {
response = proxy.getProjectTestPlans(devkey, projectid);
// if a project has no test plans this exception is thrown
} catch (XmlRpcTypeMismatchException) {
return retval;
// empty list
// happens when no plans exist. Empty response is sent back
} catch (InvalidCastException) {
return retval;
// empty list
}
handleErrorMessage(response);
if ((response is string) && ((string)response == string.Empty))
// equals null return
return retval;
XmlRpcStruct[] results = response as XmlRpcStruct[];
object[] oList = response as object[];
if ((oList.Length == 0) || (oList[0] is string))
return retval;
foreach (XmlRpcStruct result in oList) {
TestPlan tp = new TestPlan(result);
retval.Add(tp);
}
return retval;
}
/// <summary>