コード例 #1
0
ファイル: ALMRun.cs プロジェクト: Ginger-Automation/Ginger
        public ALMRun ParseXML(XElement fields)
        {
            var fieldsElements = ALMRestHelper.GetFieldsElements(fields);

            foreach (var field in fieldsElements)
            {
                string name = field.Attribute("Name").Value;
                if (name.Equals("id"))
                {
                    this.Id = field.Element("Value").Value;
                }
                else if (name.Equals("cycle-id"))
                {
                    this.TestSetId = field.Element("Value").Value;
                }
                else if (name.Equals("test-id"))
                {
                    this.TestCaseId = field.Element("Value").Value;
                }
                else if (name.Equals("testcycl-id"))
                {
                    this.TestInstanceId = field.Element("Value").Value;
                }
                else if (name.Equals("name"))
                {
                    this.Name = field.Element("Value").Value;
                }
                else if (name.Equals("status"))
                {
                    this.Status = field.Element("Value").Value;
                }
                else if (name.Equals("owner"))
                {
                    this.Owner = field.Element("Value").Value;
                }
                else
                {
                    var curName  = field.Attribute("Name").Value;
                    var curValue = field.Element("Value");

                    if (curValue == null)
                    {
                        continue;
                    }
                    var value = curValue.Value;
                    this.ElementsField.Add(curName, value);
                }
            }

            return(this);
        }
コード例 #2
0
        public ALMTestCaseStep ParseXML(XElement fields)
        {
            var fieldsElements = ALMRestHelper.GetFieldsElements(fields);

            foreach (var field in fieldsElements)
            {
                string name = field.Attribute("Name").Value;
                if (name.Equals("id"))
                {
                    this.Id = field.Element("Value").Value;
                }
                else if (name.Equals("parent-id"))
                {
                    this.TestId = field.Element("Value").Value;
                }
                else if (name.Equals("description"))
                {
                    this.Description = field.Element("Value").Value;
                }
                else if (name.Equals("step-order"))
                {
                    this.StepOrder = field.Element("Value").Value;
                }
                else if (name.Equals("name"))
                {
                    this.Name = field.Element("Value").Value;
                }
                else
                {
                    var curName  = field.Attribute("Name").Value;
                    var curValue = field.Element("Value");

                    if (curValue == null)
                    {
                        continue;
                    }
                    var value = curValue.Value;
                    this.ElementsField.Add(curName, value);
                }
            }
            return(this);
        }