Esempio n. 1
0
        public void Bpt_Tests_EmptyConstructor()
        {
            /* Initialization. */
            Bpt bptElement = new Bpt();

            /* Set of Assertions. */
            Assert.AreEqual(null, bptElement.GetXmlNode);
            Assert.AreEqual(-1, bptElement.BptId);
            Assert.AreEqual(String.Empty, bptElement.BptContent);
        }
Esempio n. 2
0
        public void Bpt_Test_Null()
        {
            /* Initialization. */
            XmlNode xmlBptNode = null;
            Bpt     bptElement = new Bpt(xmlBptNode);

            /* Set of Assertions. */
            Assert.AreEqual(null, bptElement.GetXmlNode);
            Assert.AreEqual(-1, bptElement.BptId);
            Assert.AreEqual(String.Empty, bptElement.BptContent);
        }
Esempio n. 3
0
        public void DataTest_Bpt_Tests_Methods_GetXmlAttributeValue(string inputFile, int bptPosition, string expectedAttributeName, string expectedValue)
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(inputFile);

            XmlNode xmlBptNode = xlfDocument.SelectNodes("//bpt").Item(bptPosition);
            Bpt     bptElement = new Bpt(xmlBptNode);

            /* Set of Assertions. */
            Assert.AreEqual(expectedValue, bptElement.GetXmlAttributeValue(expectedAttributeName));
        }
Esempio n. 4
0
        public void DataTest_Bpt_Tests_Properties(string inputFile, int bptPosition, int expectedIndex, string expectedContent)
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(inputFile);

            XmlNode xmlBptNode = xlfDocument.SelectNodes("//bpt").Item(bptPosition);
            Bpt     bptElement = new Bpt(xmlBptNode);

            /* Set of Assertions. */
            Assert.AreEqual(xmlBptNode, bptElement.xmlBptNode);
            Assert.AreEqual(expectedIndex, bptElement.BptId);
            Assert.AreEqual(expectedContent, bptElement.BptContent);
        }
Esempio n. 5
0
        public void Bpt_Tests_EmptyFile()
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(empty);

            XmlNode xmlBptNode = xlfDocument.SelectNodes("//bpt").Item(0);
            Bpt     bptElement = new Bpt(xmlBptNode);

            /* Set of Assertions. */
            Assert.AreEqual(null, bptElement.GetXmlNode);
            Assert.AreEqual(-1, bptElement.BptId);
            Assert.AreEqual(String.Empty, bptElement.BptContent);
        }
Esempio n. 6
0
        public void DataTest_Bpt_Tests_Methods_GetCrcAttribute(string inputFile, int bptPosition, string expectedValue)
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(inputFile);

            XmlNode xmlBptNode = xlfDocument.SelectNodes("//bpt").Item(bptPosition);
            Bpt     bptElement = new Bpt(xmlBptNode);

            XmlAttribute auxiliaryAttribute = xmlBptNode.Attributes["crc"];

            /* Set of Assertions. */
            Assert.IsNotNull(auxiliaryAttribute);
            Assert.AreEqual(expectedValue, auxiliaryAttribute.Value);
            Assert.AreEqual(auxiliaryAttribute, bptElement.GetCrcAttribute());
        }
Esempio n. 7
0
        public Source(XmlNode xmlSourceNode)
        {
            this.xmlSourceNode = xmlSourceNode;

            if (xmlSourceNode != null)
            {
                xmlSourceAttributeCollection = xmlSourceNode.Attributes;

                XmlNodeList bptNodeList = xmlSourceNode.SelectNodes("./bpt");
                Bpt         auxiliaryBpt;

                if (bptNodeList != null)
                {
                    foreach (XmlNode bptNode in bptNodeList)
                    {
                        auxiliaryBpt = new Bpt(bptNode);
                        bptList.Add(auxiliaryBpt);
                    }
                }


                XmlNodeList eptNodeList = xmlSourceNode.SelectNodes("./ept");
                Ept         auxiliaryEpt;

                if (eptNodeList != null)
                {
                    foreach (XmlNode eptNode in eptNodeList)
                    {
                        auxiliaryEpt = new Ept(eptNode);
                        eptList.Add(auxiliaryEpt);
                    }
                }


                XmlNodeList itNodeList = xmlSourceNode.SelectNodes("./it");
                It          auxiliaryIt;

                if (itNodeList != null)
                {
                    foreach (XmlNode itNode in itNodeList)
                    {
                        auxiliaryIt = new It(itNode);
                        itList.Add(auxiliaryIt);
                    }
                }


                XmlNodeList phNodeList = xmlSourceNode.SelectNodes("./ph");
                Ph          auxiliaryPh;

                if (phNodeList != null)
                {
                    foreach (XmlNode phNode in phNodeList)
                    {
                        auxiliaryPh = new Ph(phNode);
                        phList.Add(auxiliaryPh);
                    }
                }

                sourceContent = xmlSourceNode.InnerXml;
            }
            else
            {
                xmlSourceNode = null;

                sourceContent = "";
            }
        }
Esempio n. 8
0
        public Target(XmlNode xmlTargetNode)
        {
            this.xmlTargetNode = xmlTargetNode;

            if (xmlTargetNode != null)
            {
                XmlNodeList bptNodeList = xmlTargetNode.OwnerDocument.SelectNodes("\\bpt");
                Bpt         auxiliaryBpt;

                if (bptNodeList != null)
                {
                    foreach (XmlNode bptNode in bptNodeList)
                    {
                        auxiliaryBpt = new Bpt(bptNode);
                        bptList.Add(auxiliaryBpt);
                    }
                }


                XmlNodeList eptNodeList = xmlTargetNode.OwnerDocument.SelectNodes("\\ept");
                Ept         auxiliaryEpt;

                if (eptNodeList != null)
                {
                    foreach (XmlNode eptNode in eptNodeList)
                    {
                        auxiliaryEpt = new Ept(eptNode);
                        eptList.Add(auxiliaryEpt);
                    }
                }


                XmlNodeList itNodeList = xmlTargetNode.OwnerDocument.SelectNodes("\\it");
                It          auxiliaryIt;

                if (itNodeList != null)
                {
                    foreach (XmlNode itNode in itNodeList)
                    {
                        auxiliaryIt = new It(itNode);
                        itList.Add(auxiliaryIt);
                    }
                }


                XmlNodeList phNodeList = xmlTargetNode.OwnerDocument.SelectNodes("\\ph");
                Ph          auxiliaryPh;

                if (phNodeList != null)
                {
                    foreach (XmlNode phNode in phNodeList)
                    {
                        auxiliaryPh = new Ph(phNode);
                        phList.Add(auxiliaryPh);
                    }
                }
            }
            else
            {
            }
        }