/// <summary> /// Builds a dictionary of sequences containing a given test case, from the implementations of a paragraph /// </summary> /// <param name="paragraph"></param> /// <returns></returns> private Dictionary<string, string[]> findSteps(Paragraph paragraph) { Dictionary<string, string[]> retVal = new Dictionary<string, string[]>(); foreach (ReqRef reference in paragraph.Implementations) { Step step = reference.Model as Step; if (step != null) { if (retVal.ContainsKey(step.TestCase.Name)) { string steps = retVal[step.TestCase.Name][0]; string sequences = retVal[step.TestCase.Name][1]; // Only add the subsequence if it is not already in the string if (sequences.IndexOf(step.SubSequence.Name) == -1) { sequences = sequences + "\n" + step.SubSequence.Name; steps = steps + "\n" + stepNumber(step); } else { int line = getLine(sequences, step.SubSequence.Name); if (!stepPresent(line, step, steps)) { steps = steps.Insert(stepIndex(line, steps), ", " + stepNumber(step)); } } retVal[step.TestCase.Name][0] = steps; retVal[step.TestCase.Name][1] = sequences; } else { retVal[step.TestCase.Name] = new string[] {stepNumber(step), step.SubSequence.Name}; } } } return retVal; }