public override bool TryParse() { if (!base.TryParse()) { return(false); } // update the duration for the last business component TestReport ownerTest = (TestReport)OwnerTest; BusinessComponentReport lastBC = ownerTest.LastBusinessComponent; if (lastBC != null) { TimeSpan ts = StartTime - lastBC.StartTime; lastBC.DurationSeconds = (decimal)ts.TotalSeconds; } ownerTest.LastBusinessComponent = this; // steps BCSteps.Clear(); ReportNodeType[] childNodes = Node.ReportNode; if (childNodes != null) { foreach (ReportNodeType node in childNodes) { // sub-steps BCStepReport step = BCSteps.TryParseAndAdd(node, this.Node); if (step != null) { AllBCStepsEnumerator.Add(step); AllBCStepsEnumerator.Merge(step.AllBCStepsEnumerator); continue; } } } return(true); }
public override bool TryParse() { if (!base.TryParse()) { return(false); } // groups, flows, branches, bcs Groups.Clear(); Flows.Clear(); Branches.Clear(); BusinessComponents.Clear(); RecoverySteps.Clear(); GeneralSteps.Clear(); ReportNodeType[] childNodes = Node.ReportNode; if (childNodes != null) { foreach (ReportNodeType node in childNodes) { // business component BusinessComponentReport bc = BusinessComponents.TryParseAndAdd(node, this.Node); if (bc != null) { AllBCsEnumerator.Add(bc); continue; } // group GroupReport group = Groups.TryParseAndAdd(node, this.Node); if (group != null) { AllBCsEnumerator.Merge(group.AllBCsEnumerator); continue; } // flow FlowReport flow = Flows.TryParseAndAdd(node, this.Node); if (flow != null) { AllBCsEnumerator.Merge(flow.AllBCsEnumerator); continue; } // branch BranchReport branch = Branches.TryParseAndAdd(node, this.Node); if (branch != null) { AllBCsEnumerator.Merge(branch.AllBCsEnumerator); continue; } // recovery step RecoveryStepReport recovery = RecoverySteps.TryParseAndAdd(node, this.Node); if (recovery != null) { AllBCsEnumerator.Merge(recovery.AllBCsEnumerator); continue; } // general step GeneralStepReport generalStep = GeneralSteps.TryParseAndAdd(node, this.Node); if (generalStep != null) { AllBCsEnumerator.Merge(generalStep.AllBCsEnumerator); continue; } } } return(true); }
public override bool TryParse() { if (!base.TryParse()) { return(false); } // name if (string.IsNullOrWhiteSpace(Name)) { Name = Properties.Resources.Test_Step; } // groups, flows, branches, bcs Groups.Clear(); Flows.Clear(); Branches.Clear(); BusinessComponents.Clear(); RecoverySteps.Clear(); SubGeneralSteps.Clear(); ReportNodeType[] childNodes = Node.ReportNode; if (childNodes != null) { foreach (ReportNodeType node in childNodes) { // business component BusinessComponentReport bc = BusinessComponents.TryParseAndAdd(node, this.Node); if (bc != null) { AllBCsEnumerator.Add(bc); continue; } // group GroupReport group = Groups.TryParseAndAdd(node, this.Node); if (group != null) { AllBCsEnumerator.Merge(group.AllBCsEnumerator); continue; } // flow FlowReport flow = Flows.TryParseAndAdd(node, this.Node); if (flow != null) { AllBCsEnumerator.Merge(flow.AllBCsEnumerator); continue; } // branch BranchReport branch = Branches.TryParseAndAdd(node, this.Node); if (branch != null) { AllBCsEnumerator.Merge(branch.AllBCsEnumerator); continue; } // recovery steps RecoveryStepReport recovery = RecoverySteps.TryParseAndAdd(node, this.Node); if (recovery != null) { AllBCsEnumerator.Merge(recovery.AllBCsEnumerator); continue; } // sub general steps GeneralStepReport subStep = SubGeneralSteps.TryParseAndAdd(node, this.Node); if (subStep != null) { AllBCsEnumerator.Merge(subStep.AllBCsEnumerator); continue; } } } return(true); }
public override bool TryParse() { if (!base.TryParse()) { return(false); } // for the branch (case) report node, the next level node is "Step" type // case name and description is retrieved from the "Step" type node ReportNodeType[] childNodes = Node.ReportNode; if (childNodes == null || childNodes.Length == 0) { return(false); } ReportNodeType caseStepNode = childNodes[0]; if (caseStepNode.type.ToLower() != NodeType_Step) { return(false); } CaseName = caseStepNode.Data.Name; CaseDescription = caseStepNode.Data.Description; // groups, flows, branches, bcs Groups.Clear(); Flows.Clear(); Branches.Clear(); BusinessComponents.Clear(); RecoverySteps.Clear(); GeneralSteps.Clear(); childNodes = caseStepNode.ReportNode; if (childNodes != null) { foreach (ReportNodeType node in childNodes) { // business component BusinessComponentReport bc = BusinessComponents.TryParseAndAdd(node, this.Node); if (bc != null) { AllBCsEnumerator.Add(bc); continue; } // group GroupReport group = Groups.TryParseAndAdd(node, this.Node); if (group != null) { AllBCsEnumerator.Merge(group.AllBCsEnumerator); continue; } // flow FlowReport flow = Flows.TryParseAndAdd(node, this.Node); if (flow != null) { AllBCsEnumerator.Merge(flow.AllBCsEnumerator); continue; } // branch BranchReport branch = Branches.TryParseAndAdd(node, this.Node); if (branch != null) { AllBCsEnumerator.Merge(branch.AllBCsEnumerator); continue; } // recovery step RecoveryStepReport recovery = RecoverySteps.TryParseAndAdd(node, this.Node); if (recovery != null) { AllBCsEnumerator.Merge(recovery.AllBCsEnumerator); continue; } // general step GeneralStepReport generalStep = GeneralSteps.TryParseAndAdd(node, this.Node); if (generalStep != null) { AllBCsEnumerator.Merge(generalStep.AllBCsEnumerator); continue; } } } return(true); }