Exemple #1
0
        public void CanParseOldStyleBuildCode()
        {
            const string templateCode = "ABJRkncAAAAAAAAAAAAA";

            var parser = new SkillBuildParser();
            var build  = parser.ParseTemplateCode(templateCode);

            Assert.AreEqual((int)ProfessionIndex.Warrior, build.PrimaryProfessionId);
            Assert.AreEqual((int)ProfessionIndex.Necromancer, build.SecondaryProfessionId);

            Assert.AreEqual(2, build.AttributeIdValuePairs.Count());
            Assert.IsTrue(build.AttributeIdValuePairs.ContainsPair((int)AttributeIndex.Strength, 12));
            Assert.IsTrue(build.AttributeIdValuePairs.ContainsPair((int)AttributeIndex.HammerMastery, 12));

            Assert.AreEqual(8, build.SkillIds.Count());

            /* 8 x NoSkill */
            Assert.AreEqual(0, build.SkillIds.First());
            Assert.AreEqual(0, build.SkillIds.Skip(1).First());
            Assert.AreEqual(0, build.SkillIds.Skip(2).First());
            Assert.AreEqual(0, build.SkillIds.Skip(3).First());
            Assert.AreEqual(0, build.SkillIds.Skip(4).First());
            Assert.AreEqual(0, build.SkillIds.Skip(5).First());
            Assert.AreEqual(0, build.SkillIds.Skip(6).First());
            Assert.AreEqual(0, build.SkillIds.Skip(7).First());
        }
Exemple #2
0
        public void CannotParseInvalidBase64String()
        {
            var parser = new SkillBuildParser();
            var result = parser.ParseTemplateCode("pad!£$%^&*()_+-={}[]:@~;'#<>?,./");

            Assert.IsNull(result);
        }
Exemple #3
0
        public void CanParseNewStyleBuildCode()
        {
            const string templateCode = "OwAT043A5JjsR0I3tp/m2mITAA";

            var parser = new SkillBuildParser();

            var build = parser.ParseTemplateCode(templateCode);

            Assert.AreEqual((int)ProfessionIndex.Monk, build.PrimaryProfessionId);
            Assert.AreEqual((int)ProfessionIndex.None, build.SecondaryProfessionId);

            Assert.AreEqual(3, build.AttributeIdValuePairs.Count());
            Assert.IsTrue(build.AttributeIdValuePairs.ContainsPair((int)AttributeIndex.ProtectionPrayers, 3));
            Assert.IsTrue(build.AttributeIdValuePairs.ContainsPair((int)AttributeIndex.DivineFavor, 12));
            Assert.IsTrue(build.AttributeIdValuePairs.ContainsPair((int)AttributeIndex.HealingPrayers, 12));

            Assert.AreEqual(8, build.SkillIds.Count());
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.OrisonofHealing));
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.DwaynasKiss));
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.WordofHealing));
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.SignetofRejuvenation));
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.CureHex));
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.DismissCondition));
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.DivineSpirit));
            Assert.IsTrue(build.SkillIds.Contains((int)SkillIndex.Rebirth));
        }
Exemple #4
0
        public void WillNotParseInvalidTemplates()
        {
            const string templateCode = "this will not parse";

            var parser = new SkillBuildParser();
            var build  = parser.ParseTemplateCode(templateCode);

            Assert.AreSame(null, build);
        }