/// <summary> /// Add new controls for action and expected result Then fill them with Step data. /// </summary> /// <param name="step"></param> /// <param name="boxWeight"></param> /// <param name="x"></param> /// <param name="y"></param> private void AddStep(Step step, int boxWeight, int x, int y) { this.pnlActions.Controls.Add(this.CreateStepNumberLabel(step.StepNumber, x, y)); Control actions = this.CreateCaseTextBox(step.Action, boxWeight, x, y); actions.Tag = step; this.pnlActions.Controls.Add(actions); this.pnlExpections.Controls.Add(this.CreateStepNumberLabel(step.StepNumber, x, y)); Control expectations = this.CreateCaseTextBox(step.ExpectedResult, boxWeight, x, y); expectations.Tag = step; this.pnlExpections.Controls.Add(expectations); }
private Step AddStep(XmlNode node) { Step step = new Step(); foreach (XmlNode n in node.ChildNodes) { if (n.Name == "step_number") step.StepNumber = int.Parse(n.InnerText); else if (n.Name == "actions") step.Action = n.InnerText; else if (n.Name == "expectedresults") step.ExpectedResult = n.InnerText; } return step; }
private void btnOK_Click(object sender, EventArgs e) { this.Step = new Step() { Action = txtAction.Text, ExpectedResult = txtExpectations.Text, StepNumber = (int)nudStepNumber.Value }; }
private XmlNode WriteStep(Step step) { XmlElement node = this.suite.CreateElement("", "step", ""); XmlElement stepNumber = this.suite.CreateElement("", "step_number", ""); stepNumber.AppendChild(this.suite.CreateCDataSection(step.StepNumber.ToString())); node.AppendChild(stepNumber); XmlElement actions = this.suite.CreateElement("", "actions", ""); actions.AppendChild(this.suite.CreateCDataSection(step.Action)); node.AppendChild(actions); XmlElement expectedresults = this.suite.CreateElement("", "expectedresults", ""); expectedresults.AppendChild(this.suite.CreateCDataSection(step.ExpectedResult)); node.AppendChild(expectedresults); return node; }
public NewStepDialog() { InitializeComponent(); Step = new Step(); }