コード例 #1
0
 private void MergeAndClearList()
 {
     if (mAct.ProjectInnerProperties.Count > 0)
     {
         foreach (var innerProperty in mAct.ProjectInnerProperties)
         {
             var item = mAct.ProjectProperties.Where(l => l.Param == innerProperty.Param).FirstOrDefault();
             if (item == null)
             {
                 mAct.ProjectProperties.Add(innerProperty);
             }
         }
         mAct.ProjectInnerProperties.Clear();
     }
     if (mAct.ProjectProperties.Count > 0)
     {
         foreach (var item in mAct.ProjectProperties)
         {
             ActSoapUiInputValue actUiInput = new ActSoapUiInputValue(ActSoapUiInputValue.ePropertyType.Project, item);
             mAct.AllProperties.Add(actUiInput);
         }
         mAct.ProjectProperties.Clear();
     }
     if (mAct.TestSuiteProperties.Count > 0)
     {
         foreach (var item in mAct.TestSuiteProperties)
         {
             ActSoapUiInputValue actUiInput = new ActSoapUiInputValue(ActSoapUiInputValue.ePropertyType.TestSuite, item);
             mAct.AllProperties.Add(actUiInput);
         }
         mAct.TestSuiteProperties.Clear();
     }
     if (mAct.TestCaseProperties.Count > 0)
     {
         foreach (var item in mAct.TestCaseProperties)
         {
             ActSoapUiInputValue actUiInput = new ActSoapUiInputValue(ActSoapUiInputValue.ePropertyType.TestCase, item);
             mAct.AllProperties.Add(actUiInput);
         }
         mAct.TestCaseProperties.Clear();
     }
     if (mAct.TestStepProperties.Count > 0)
     {
         foreach (var item in mAct.TestStepProperties)
         {
             ActSoapUiInputValue actUiInput = new ActSoapUiInputValue(ActSoapUiInputValue.ePropertyType.TestStep, item);
             mAct.AllProperties.Add(actUiInput);
         }
         mAct.TestStepProperties.Clear();
     }
     if (!string.IsNullOrEmpty(mAct.GetInputParamCalculatedValue(ActSoapUI.Fields.TestCase)) && !string.IsNullOrEmpty(mAct.GetInputParamCalculatedValue(ActSoapUI.Fields.TestSuite)))
     {
         TestSuiteComboBox.SelectedValue = mAct.GetInputParamCalculatedValue(ActSoapUI.Fields.TestSuite);
         TestCaseComboBox.SelectedValue  = mAct.GetInputParamCalculatedValue(ActSoapUI.Fields.TestCase);
         PopulateTestCasePropertiesList();
     }
 }
コード例 #2
0
        private void PopulatePropertiesGrid(XmlNodeList properties, ActSoapUiInputValue.ePropertyType propertiesType)
        {
            foreach (XmlNode property in properties)
            {
                ActSoapUiInputValue testProperty = new ActSoapUiInputValue();
                XmlNodeList         propertyTags = property.ChildNodes;
                foreach (XmlNode tag in propertyTags)
                {
                    if (tag.Name == "con:name")
                    {
                        testProperty.Param = tag.InnerText;
                    }
                    if (tag.Name == "con:value")
                    {
                        testProperty.Value = tag.InnerText;
                    }
                }
                //update Property type Field
                testProperty.Type = propertiesType.ToString();

                if (mAct.TempProperties.Count > 0)
                {
                    var savedProperty = mAct.TempProperties.Where(x => x.Param == testProperty.Param && x.Type == testProperty.Type.ToString()).FirstOrDefault();
                    if (savedProperty != null)
                    {
                        var savedPropertyValue = savedProperty.Value;
                        if (!string.IsNullOrEmpty(savedPropertyValue))
                        {
                            testProperty.Value = savedPropertyValue;
                        }
                    }
                }

                mAct.AllProperties.Add(testProperty);
            }
        }