public static void TestPlanLoad(string data, TestPlan testPlan) { XmlDocument scriptDoc = new XmlDocument(); scriptDoc.LoadXml(data); foreach (XmlNode planNode in scriptDoc.GetElementsByTagName("test")) { testPlan.name = GetNodeString(planNode.Attributes, "name"); } foreach (XmlNode testNode in scriptDoc.GetElementsByTagName("test_script")) { foreach (XmlNode assessNode in testNode.SelectNodes("assessment")) { AssessScriptData assess = new AssessScriptData(); assess.problemCount = int.Parse(GetNodeString(assessNode.Attributes, "problem_count")); string use_mark_all = GetNodeString(assessNode.Attributes, "mark_all"); if (use_mark_all != null) { assess.useMarkAll = true; assess.markAll = (use_mark_all == "true") ? true : false; } assess.expectSuccess = (GetNodeString(assessNode.Attributes, "expect_success") == "true" ? true : false); assess.groupId = GetNodeString(assessNode.Attributes, "group_id"); GetAssessSkillList(assessNode, assess); assess.tutorData = GetTutorData(assessNode); assess.checkForProblemDupes = (GetNodeString(assessNode.Attributes, "check_dupes") == "true" ? true : false); testPlan.scripts.Add(assess); } } }
public bool RunScript() { Console.WriteLine("***************************************************"); Console.WriteLine("Beginning Test Execution: " + planData.name); seenProblems = new List <string>(); bool result = false; foreach (AssessScriptData script in planData.scripts) { actResp = new ActionResponse(); currentScript = script; if (!(result = DoAssessment(ita.CreateAssessmentBuilder()))) { break; } } if (result) { Console.Write("SUCCESS: "); } else { Console.Write("FAILED: "); } Console.WriteLine("Test Named : " + planData.name); Console.WriteLine("***************************************************"); return(result); }
private static void GetAssessSkillList(XmlNode node, AssessScriptData assess) { XmlNode verifySkillNode = node.SelectNodes("verify_skills") [0]; if (verifySkillNode == null) { return; } assess.verifySkills = verifySkillNode.Attributes.GetNamedItem("list").InnerText; }