Example #1
0
        public void findLastUnvisitedSpTest()
        {
            try
            {
                POS sp1 = new POS(0, 0, 0, 2, 0);
                POS sp2 = new POS(0, 0, 0, 2, 0);
                List<POS> spList = new List<POS>();
                spList.Add(sp1);
                spList.Add(sp2);

                List<POS> visitedSpList = new List<POS>();
                visitedSpList.Add(sp1);

                Storyline np = new Storyline(0, 4);
                np.setStorypointList(spList);
                np.setVisitedStorypointList(visitedSpList);

                Assert.IsNotNull(sp1);
                Assert.IsNotNull(sp2);
                Assert.IsNotNull(np);
                Assert.IsNotNull(spList);
                Assert.IsNotNull(visitedSpList);
                Assert.Equals(sp1, np.findLastUnvisitedSp());
            }
            catch (SecurityException e)
            {
                Console.WriteLine("Security Exception:\n\n{0}", e.Message);
            }
        }
Example #2
0
        public void isInOrderTest()
        {
            try
            {
                POS sp1 = new POS(0, 0, 0, 2, 0);
                POS sp2 = new POS(0, 0, 0, 2,  0);
                List<POS> spList = new List<POS>();
                spList.Add(sp1);
                spList.Add(sp2);
                Storyline np = new Storyline(0, 4);
                np.setStorypointList(spList);

                Assert.True(np.isInOrder(sp1));
            }
            catch (SecurityException e)
            {
                Console.WriteLine("Security Exception:\n\n{0}", e.Message);
            }
        }
Example #3
0
 public void addStoryline(Storyline sl)
 {
     storylines.Add(sl);
 }
Example #4
0
        public List<Storyline> PopulateStorylines()
        {
            List<Storyline> storylineList = new List<Storyline>();

            foreach (JSONObject s in storylines.list)
            {
                Storyline storyline = new Storyline((int)s.list[0].n, s.list[6].Count);
                foreach (JSONObject nodeid in s.list[3].list)
                {
                    storyline.addToPath((int)nodeid.n);
                }

                for (int i = 0; i < s.list[1].list.Count; i++)
                {
                    Description storylineDescription = new Description(s.list[1].list[i].list[1].str,
                        s.list[2].list[i].list[1].str, s.list[1].list[i].list[0].str);
                    storyline.addStorylineDescription(storylineDescription);
                }
                storylineList.Add(storyline);
            }

            return storylineList;
        }