示例#1
0
        public void Add_ShouldConcatenateTwoMessageListInTheCorrectOrder()
        {
            string[] storyEvents = { "Story Started", "Heros are summoned", "Saber wins the grail", "Story Ended" };

            var storyPlot = new StoryPlot();

            storyPlot.PlotEvents.Add(storyEvents[0]);
            storyPlot.PlotEvents.Add(storyEvents[1]);

            var newStoryEvents = new StoryPlot();

            newStoryEvents.PlotEvents.Add(storyEvents[2]);
            newStoryEvents.PlotEvents.Add(storyEvents[3]);

            storyPlot.Add(newStoryEvents);

            for (int i = 0; i < storyPlot.PlotEvents.Count; i++)
            {
                Assert.AreEqual(storyPlot.PlotEvents[i], storyEvents[i]);
            }
        }
示例#2
0
 public StoryPlot BreakAlliance(Alliance alliance)
 {
     if (Alliances.Count != 0)
     {
         if (Alliances.Remove(alliance))
         {
             MagesWithNoAlliances.Add(alliance.Mage1);
             MagesWithNoAlliances.Add(alliance.Mage2);
             var sp = new StoryPlot();
             sp.PlotEvents.Add("Alliance is broken");
             return(sp);
         }
         else
         {
             //if the alliance we want to break does not exist in the list of alliances
             return(null);
         }
     }
     else
     {
         return(null);
     }
 }