public static Stream Export(Project project) { var testCase = Utils.GetResourceTextFile("soapUI-TestCase.xml"); var testStep = Utils.GetResourceTextFile("soapUI-TestStep.xml"); var dic = new Dictionary<string, int>(); var sb = new StringBuilder(); var sbSteps = new StringBuilder(); foreach (var s in project.Steps) { var index = 0; if (!dic.ContainsKey(s.Name)) { dic.Add(s.Name, index); } dic[s.Name]++; var stepName = string.Format("{0} - {1}", s.Name, dic[s.Name]); var content = s.Message.Payload.TrimEnd('\0'); sbSteps.AppendFormat(testStep, stepName, content, s.UrlResponse); sbSteps.AppendLine(); } sb.AppendFormat(testCase, project.Name, sbSteps.ToString()); var bytes = Encoding.UTF8.GetBytes(sb.ToString()); var ms = new MemoryStream(bytes); return ms; }
public ProjectForm(Project p = null) { InitializeComponent(); _project = new Project(); if (p != null) { _project = p; FillTreeView(_project.Steps); tbName.Text = _project.Name; tbReqNumber.Text = _project.BusinessId; } cbxConnections.DataSource = Configuration.Connections; cbxConnections.DisplayMember = "Name"; testStepControl1.LoadTestStep(null); }
public ProjectInstance(Project p) : this() { Project = p; }