예제 #1
0
        public void CharacterCalcsLP_NoDuplicates()
        {
            Character c = new Character();

            c.AddLifepath(LifepathIndex.getLifepathByNameSetting("Born Peasant", "Human_Peasant"));
            Assert.AreEqual(CharacterCalc.LifepathLeadsCount(c), 0);
            Assert.AreEqual(0, CharacterCalc.LifepathRequiredSkills(c).Count);
            Assert.AreEqual(0, CharacterCalc.LifepathRequiredTraits(c).Count);
            Assert.AreEqual(8, CharacterCalc.LifepathYearsCount(c));

            //Ensure same setting doesn't lead
            Lifepath tmpLP = LifepathIndex.getLifepathByNameSetting("Born Peasant", "Human_Peasant");

            c.AddLifepath(tmpLP);
            Assert.AreEqual(2, c.LifepathList.Count);
            Assert.AreEqual(0, CharacterCalc.LifepathLeadsCount(c));
            c.DropLifepath(tmpLP);
            Assert.AreEqual(1, c.LifepathList.Count);

            c.AddLifepath(LifepathIndex.getLifepathByNameSetting("Boy", "Human_Seafaring"));
            Assert.AreEqual(1, CharacterCalc.LifepathBornCount(c));
            Assert.AreEqual(11, CharacterCalc.LifepathResourcePoints(c));
            Assert.AreEqual(1, CharacterCalc.LifepathLeadsCount(c));
            Assert.AreEqual(13, CharacterCalc.LifepathYearsCount(c)); //8 + 4 (+ 1 Leads)
            Assert.AreEqual(3, CharacterCalc.LifepathGeneralPoints(c));
            Assert.AreEqual(4, CharacterCalc.LifepathSkillPoints(c));
            Assert.AreEqual(3, CharacterCalc.LifepathTraitPoints(c));
            Assert.AreEqual(1, CharacterCalc.LifepathRequiredSkills(c).Count);
            Assert.AreEqual("Sailor-wise", CharacterCalc.LifepathRequiredSkills(c)[0], CharacterCalc.LifepathRequiredSkills(c)[0]);
            Assert.AreEqual(1, CharacterCalc.LifepathRequiredTraits(c).Count);
            Assert.AreEqual("Veneer of Obedience", CharacterCalc.LifepathRequiredTraits(c)[0]);

            c.AddLifepath(LifepathIndex.getLifepathByNameSetting("Boy", "Human_Seafaring"));
            Assert.AreEqual(17, CharacterCalc.LifepathYearsCount(c)); //8 + 4 + 4 (+ 1 Leads)
        }
예제 #2
0
        public void LifepathEquivalenceValid()
        {
            Lifepath lpA = LifepathIndex.getLifepathByNameSetting("Boy", "Human_Seafaring");

            Assert.IsNotNull(lpA);
            Lifepath lpB = LifepathIndex.getLifepathByNameSetting("Boy", "Human_Seafaring");

            Assert.IsNotNull(lpB);

            Assert.IsTrue(LifepathIndex.AreEquivalent(lpA, lpB));
        }
예제 #3
0
        public void CharacterReceivesLP()
        {
            Character c           = new Character();
            Lifepath  BornPeasant = LifepathIndex.getLifepathByNameSetting("Born Peasant", "Human_Peasant");

            Assert.IsNotNull(BornPeasant);

            c.AddLifepath(BornPeasant);
            Assert.AreEqual(c.LifepathList.Count, 1);

            Assert.IsTrue(c.DropLifepath(BornPeasant));
            Assert.IsFalse(c.DropLifepath(BornPeasant));
        }
예제 #4
0
        public void LifepathFetchCorrectly()
        {
            List <Lifepath> list = LifepathIndex.getLifepathByName("Born Peasant");

            Assert.IsNotNull(list);
            Assert.AreEqual(list.Count, 1);
            Assert.AreEqual(list[0].Name, "Born Peasant");

            Lifepath lp = LifepathIndex.getLifepathByNameSetting("Born Peasant", "Human_Peasant");

            Assert.IsNotNull(lp);
            Assert.AreNotSame(list[0], lp);
        }
예제 #5
0
        public void LifepathSearchByRace()
        {
            List <Lifepath> listA = LifepathIndex.getLifepathByRace("Human");
            List <Lifepath> listB = LifepathIndex.getLifepathByRace("Flimblejamble");

            Assert.AreNotEqual(0, listA.Count);
            Assert.AreEqual(0, listB.Count);
            foreach (Lifepath lp in listA)
            {
                Assert.IsTrue(lp.Setting.StartsWith("Human"));
            }

            Lifepath lpA = LifepathIndex.getLifepathByNameSetting("Born Peasant", "Human_Peasant");

            foreach (Lifepath lp in listA)
            {
                Assert.AreNotSame(lp, lpA);
            }
        }