Exemplo n.º 1
0
        public void TestCanBeUnlockedRoundHouseKick_WithUnlockedParents()
        {
            var graphBuilderWarrior = new GraphBuilder();
            var rootNode            = new SkillNode("Warrior", true, true);
            var strikeNode          = new SkillNode("Strike");
            var roundHouseKick      = new SkillNode("Roundhouse Kick");
            var slashNode           = new SkillNode("Slash");
            var hitNode             = new SkillNode("Hit");
            var knockoutNode        = new SkillNode("Knockout");
            var doubleStrikeNode    = new SkillNode("Double Strike");

            graphBuilderWarrior
            .AddBranchNode(rootNode)
            .AddBranchNode(strikeNode)
            .AddNode(doubleStrikeNode)
            .AddNodeFromClosestBranchNode(slashNode)
            .AddNode(roundHouseKick)
            .AddNodeFromClosestBranchNode(hitNode)
            .AddNode(knockoutNode)
            .AddNode(roundHouseKick);


            var skillGrappProvider = new SkillsGraphProvider(new GraphWalker(new LockMarkuper()));

            skillGrappProvider.Unlock(rootNode);

            skillGrappProvider.Unlock(strikeNode);

            skillGrappProvider.Unlock(slashNode);

            skillGrappProvider.Unlock(hitNode);

            skillGrappProvider.Unlock(knockoutNode);

            Assert.AreEqual(true, roundHouseKick.CanBeUnlocked());
        }