예제 #1
0
 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;
 }
예제 #3
0
 private static Actor CreateActor(XElement element)
 {
     var name = "";
     var nameAttribute = element.Attribute("TEXT");
     if(nameAttribute != null)
     {
         name = nameAttribute.Value;
     }
     var actor = new Actor(name)
                     {
                         Stories = element.Elements("node").Select(CreateStory)
                     };
     return actor;
 }
예제 #4
0
 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);
         }
     }
 }
예제 #5
0
 public String GetNarrative(Actor actor)
 {
     var article = IsVowel(actor.Name[0]) && actor.Name.ToLower() != "user" ? "an" : "a";
     var text = Char.ToLower(Text[0]) + Text.Substring(1);
     return String.Format("As {0} {1} I {2}.", article, actor.Name, text);
 }
 private IEnumerable<Ticket> GetTicketsFromActor(Actor actor)
 {
     return actor.Stories.Select(x => CreateTicket(actor, x));
 }