private static void AddStoryToFile(FileStream file, Story story, Actor actor) { var line = String.Format("\"{0}\",\"{1}\",\"{2}\"\n", story.Title, story.GetNarrative(actor), String.Join(",", story.RelatedRequirements)); var bytes = Encoding.UTF8.GetBytes(line); file.Write(bytes, 0, bytes.Length); foreach (var s in story.Children) { AddStoryToFile(file, s, actor); } }
private Ticket CreateTicket(Actor actor, Story story) { var ticket = new Ticket() { Description = story.GetNarrative(actor), Summary = story.Title, Children = story.Children.Select(x => CreateTicket(actor, x)), Actor = actor.Name }; return ticket; }
private static Story CreateStory(XElement element) { var text = ""; var textAttribute = element.Attribute("TEXT"); if(textAttribute != null) { text = textAttribute.Value; } var story = new Story(text) { Children = element.Elements("node").Select(CreateStory) }; return story; }
private static void AppendStory(Body body, Actor actor, Story story, List<int> level) { var sectionNumber = level.Last() + 1; var sectionList = level.Take(level.Count - 1).ToList(); sectionList.Add(sectionNumber); var sectionDisplay = String.Join(".", sectionList); AddText(body, sectionDisplay + " - " + story.Title, level.Count); AddTextWithHeading(body, "Story", story.GetNarrative(actor)); AddTextWithHeading(body, "Requirements Met", String.Join(", ", story.RelatedRequirements)); if (story.Children.Any()) { var sectionCount = 0; sectionList.Add(sectionCount); foreach (var s in story.Children) { AppendStory(body, actor, s, sectionList); sectionCount++; sectionList.RemoveAt(sectionList.Count-1); sectionList.Add(sectionCount); } } }