Ejemplo n.º 1
0
        public void GotActionRefNode4()
        {
            string        filename = @"Content\ActionRefEmpty.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode testBulletNode = testFireNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode);
        }
Ejemplo n.º 2
0
        public void GotActionRefNode3()
        {
            var           filename = new Filename(@"ActionRefEmpty.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode testBulletNode = testFireNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode.GetChild(ENodeName.actionRef));
        }
Ejemplo n.º 3
0
        public void GotParamNode3()
        {
            var           filename = TestUtils.GetFilePath(@"Content\ActionRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.Parse(filename);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(NodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(NodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(NodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(NodeName.actionRef) as ActionRefNode;

            Assert.IsNotNull(testActionRefNode.GetChild(NodeName.param) as ParamNode);
        }
Ejemplo n.º 4
0
        public void FoundCorrectActionNode()
        {
            string        filename = @"Content\ActionRefParam.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(ENodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode;
            ActionNode    refNode           = testActionRefNode.ReferencedActionNode as ActionNode;

            Assert.AreEqual(refNode.Label, "test2");
        }
Ejemplo n.º 5
0
        public void FoundActionNode2()
        {
            var           filename = new Filename(@"ActionRefEmpty.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(ENodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode;
            ActionNode    refNode           = testActionRefNode.ReferencedActionNode as ActionNode;

            Assert.AreEqual(refNode.Label, "test");
        }
Ejemplo n.º 6
0
        public void FoundCorrectActionNode()
        {
            var           filename = TestUtils.GetFilePath(@"Content\ActionRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.Parse(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(NodeName.action) as ActionNode;

            Assert.IsNotNull(testActionNode);
            FireNode testFireNode = testActionNode.GetChild(NodeName.fire) as FireNode;

            Assert.IsNotNull(testFireNode);
            BulletNode testBulletNode = testFireNode.GetChild(NodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode);
            ActionRefNode testActionRefNode = testBulletNode.GetChild(NodeName.actionRef) as ActionRefNode;

            Assert.IsNotNull(testActionRefNode);
            ActionNode refNode = testActionRefNode.ReferencedActionNode;

            Assert.IsNotNull(testActionNode);
            Assert.AreEqual("test2", refNode.Label);
        }