public void Add(AutomationActionAttribute attribute) { if (this.AttributeList == null) { this.AttributeList = new List <AutomationActionAttribute>(); } this.AttributeList.Add(attribute); }
public void Test_ConfigurationSerialize() { WebAutomationConfig config = new WebAutomationConfig(); config.Name = "Test1"; config.Version = "0.1"; AutomationStep step = new AutomationStep(); step.Name = "aaa"; step.ActionList = new System.Collections.Generic.List<AutomationAction>(); config.Add(step); AutomationAction action = new AutomationAction(); action.Type = "Wait"; AutomationActionAttribute attr = new AutomationActionAttribute(); attr.Name = "name"; attr.Value = "value"; action.Add(attr); AutomationAction childAction = new AutomationAction(); childAction.Type = "Click"; childAction.Add(attr); action.AddChild(childAction); step.Add(action); WebAutomationConfig.Save(config); WebAutomationConfig loadConfig = WebAutomationConfig.Load(); Assert.IsNotNull(loadConfig); Assert.AreEqual(loadConfig.Name, config.Name); Assert.AreEqual(loadConfig.StepList.Count, config.StepList.Count); Assert.AreEqual(loadConfig.StepList[0].Name, config.StepList[0].Name); }
public void Add(AutomationActionAttribute attribute) { if (this.AttributeList == null) { this.AttributeList = new List<AutomationActionAttribute>(); } this.AttributeList.Add(attribute); }