public static TestCase GetNewTestCase(FlowTest flowTest) { TestCase tc = flowTest.TC; tc.tcbList.Clear(); foreach (IStep step in (List <IStep>)flowTest.Steps) { TestCaseBase tcb = new TestCaseBase(); if (step is RequestBuildStep) { tcb = StepToTestCaseRequest((RequestBuildStep)step); } else if (step is ResponseCheckStep) { tcb = StepToTestCaseResponse((ResponseCheckStep)step); } tc.tcbList.Add(tcb); } return(tc); }
/// <summary> /// read the xml file and translate it to object. /// </summary> /// <param name="fileName"></param> /// <returns></returns> public static List <FlowTest> Read(String fileName) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); XmlNode root = xmlDoc.SelectSingleNode("root"); if (root == null) { return(null); } XmlNodeList xnList = root.ChildNodes; List <FlowTest> ftList = new List <FlowTest>(); foreach (XmlNode node in xnList) { TestCase tc = NodeToTestCase(node); FlowTest ft = new FlowTest(tc.Name, tc.Objective); ft.TC = tc; ftList.Add(ft); } return(ftList); }
public static int Compare(FlowTest ft1, FlowTest ft2) { return(ft1.TC.Group.CompareTo(ft2.TC.Group)); }