示例#1
0
        /// <summary>Parse a json object to a PlanEntry</summary>
        /// <param name="json">json object to parse</param>
        /// <returns>PlanEntry corresponding to a json object</returns>
        public static PlanEntry Parse(JObject json)
        {
            PlanEntry pe = new PlanEntry();
            pe.ID = (string)json["id"];
            pe.SuiteID = (ulong?)json["suite_id"];
            pe.Name = (string)json["name"];
            pe.AssignedToID = (ulong?)json["assignedto_id"];
            pe.IncludeAll = (bool?)json["include_all"];

            pe.RunIDList = _ConvertToRunIDs(json["runs"] as JArray);
            pe.CaseIDs = _ConvertToCaseIDs(json["case_ids"] as JArray);
            return pe;
        }
示例#2
0
        /// <summary>Parse a json object to a PlanEntry</summary>
        /// <param name="json">json object to parse</param>
        /// <returns>PlanEntry corresponding to a json object</returns>
        public static PlanEntry Parse(JObject json)
        {
            PlanEntry pe = new PlanEntry();
            pe.ID = (string)json["id"];
            pe.SuiteID = (ulong?)json["suite_id"];
            pe.Name = (string)json["name"];
            pe.AssignedToID = (ulong?)json["assignedto_id"];
            pe.IncludeAll = (bool?)json["include_all"];

            pe.RunIDList = _ConvertToRunIDs(json["runs"] as JArray);
            pe.CaseIDs = _ConvertToCaseIDs(json["case_ids"] as JArray);

            JArray jarray = json["runs"] as JArray;
            if (null != jarray)
            {
                pe.RunList = JsonUtility.ConvertJArrayToList<Run>(jarray, Run.Parse);
            }
            return pe;
        }
示例#3
0
        /// <summary>Parse a json object to a PlanEntry</summary>
        /// <param name="json">json object to parse</param>
        /// <returns>PlanEntry corresponding to a json object</returns>
        public static PlanEntry Parse(JObject json)
        {
            var pe = new PlanEntry
            {
                JsonFromResponse = json,
                ID = (string)json["id"],
                SuiteID = (ulong?)json["suite_id"],
                Name = (string)json["name"],
                AssignedToID = (ulong?)json["assignedto_id"],
                IncludeAll = (bool?)json["include_all"],

                RunIDList = _ConvertToRunIDs(json["runs"] as JArray),
                CaseIDs = _ConvertToCaseIDs(json["case_ids"] as JArray),
            };

            var jarray = json["runs"] as JArray;
            if (null != jarray)
            {
                pe.RunList = JsonUtility.ConvertJArrayToList<Run>(jarray, Run.Parse);
            }
            return pe;
        }