Ejemplo n.º 1
0
        /// <summary>
        ///  This is used for the call GetTestCasesForTestPlan
        ///  using the returned list from TestLink, generate a list of data
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public static List <TestCaseFromTestPlan> GenerateFromResponse(XmlRpcStruct list)
        {
            var result = new List <TestCaseFromTestPlan>();

            if (list != null)
            {
                foreach (var o in list.Values)
                {
                    TestCaseFromTestPlan tc = null;
                    if (o is XmlRpcStruct)
                    {
                        var list2 = o as XmlRpcStruct;
                        foreach (var o2 in list2.Values)
                        {
                            tc = ToTestCaseFromTestPlan(o2 as XmlRpcStruct);
                            result.Add(tc);
                        }
                    }
                    else
                    {
                        var olist = o as object[];
                        tc = ToTestCaseFromTestPlan(olist[0] as XmlRpcStruct);
                        result.Add(tc);
                    }
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        internal static TestCaseFromTestPlan ToTestCaseFromTestPlan(XmlRpcStruct data)
        {
            var item = new TestCaseFromTestPlan();

            if (data.ContainsKey("active"))
            {
                item.active = int.Parse((string)data["active"]) == 1;
            }
            item.name             = (string)data["name"];
            item.tsuite_name      = (string)data["tsuite_name"];
            item.z                = ToInt(data, "z");
            item.type             = (string)data["type"];
            item.execution_order  = ToInt(data, "execution_order");
            item.exec_id          = ToInt(data, "exec_id");
            item.tc_id            = ToInt(data, "tc_id");
            item.tcversion_number = ToInt(data, "tcversion_number");
            item.status           = (string)data["status"];
            item.external_id      = (string)data["external_id"];
            item.exec_status      = (string)data["exec_status"];
            item.exec_on_tplan    = ToInt(data, "exec_on_tplan");
            item.executed         = ToInt(data, "executed");
            item.feature_id       = ToInt(data, "feature_id");
            item.assigner_id      = ToInt(data, "assigner_id");
            item.user_id          = ToInt(data, "user_id");
            item.active           = ToInt(data, "active") == 1;
            item.version          = ToInt(data, "version");
            item.testsuite_id     = ToInt(data, "testsuite_id");
            item.tcversion_id     = ToInt(data, "tcversion_id");
            //steps = (string)data["steps"];
            //expected_results = (string)data["expected_results"];
            item.summary            = (string)data["summary"];
            item.execution_type     = ToInt(data, "execution_type");
            item.platform_id        = ToInt(data, "platform_id");
            item.platform_name      = (string)data["platform_name"];
            item.linked_ts          = ToDate(data, "linked_ts");
            item.linked_by          = ToInt(data, "linked_by");
            item.importance         = ToInt(data, "importance");
            item.execution_run_type = (string)data["execution_run_type"];
            item.execution_ts       = (string)data["execution_ts"];
            item.tester_id          = ToInt(data, "tester_id");
            item.execution_notes    = (string)data["execution_notes"];
            item.exec_on_build      = ToInt(data, "exec_on_build");
            item.assigned_build_id  = ToInt(data, "assigned_build_id");
            item.urgency            = ToInt(data, "urgency");
            item.priority           = ToInt(data, "priority");

            return(item);
        }