Beispiel #1
0
        public void Ept_Tests_EmptyConstructor()
        {
            /* Initialization. */
            Ept eptElement = new Ept();

            /* Set of Assertions. */
            Assert.AreEqual(null, eptElement.GetXmlNode);
            Assert.AreEqual(-1, eptElement.EptId);
            Assert.AreEqual(String.Empty, eptElement.EptContent);
        }
Beispiel #2
0
        public void Ept_Test_Null()
        {
            /* Initialization. */
            XmlNode xmlEptNode = null;
            Ept     eptElement = new Ept(xmlEptNode);

            /* Set of Assertions. */
            Assert.AreEqual(null, eptElement.GetXmlNode);
            Assert.AreEqual(-1, eptElement.EptId);
            Assert.AreEqual(String.Empty, eptElement.EptContent);
        }
Beispiel #3
0
        public void DataTest_Ept_Tests_Methods_GetXmlAttributeValue(string inputFile, int eptPosition, string expectedAttributeName, string expectedValue)
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(inputFile);

            XmlNode xmlEptNode = xlfDocument.SelectNodes("//ept").Item(eptPosition);
            Ept     eptElement = new Ept(xmlEptNode);

            /* Set of Assertions. */
            Assert.AreEqual(expectedValue, eptElement.GetXmlAttributeValue(expectedAttributeName));
        }
Beispiel #4
0
        public void DataTest_Ept_Tests_Properties(string inputFile, int eptPosition, int expectedIndex, string expectedContent)
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(inputFile);

            XmlNode xmlEptNode = xlfDocument.SelectNodes("//ept").Item(eptPosition);
            Ept     eptElement = new Ept(xmlEptNode);

            /* Set of Assertions. */
            Assert.AreEqual(xmlEptNode, eptElement.xmlEptNode);
            Assert.AreEqual(expectedIndex, eptElement.EptId);
            Assert.AreEqual(expectedContent, eptElement.EptContent);
        }
Beispiel #5
0
        public void Ept_Tests_EmptyFile()
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(empty);

            XmlNode xmlEptNode = xlfDocument.SelectNodes("//ept").Item(0);
            Ept     eptElement = new Ept(xmlEptNode);

            /* Set of Assertions. */
            Assert.AreEqual(null, eptElement.GetXmlNode);
            Assert.AreEqual(-1, eptElement.EptId);
            Assert.AreEqual(String.Empty, eptElement.EptContent);
        }
Beispiel #6
0
        public void DataTest_Ept_Tests_Methods_GetCrcAttribute(string inputFile, int eptPosition, string expectedValue)
        {
            /* Initialization. */
            XmlDocument xlfDocument = new XmlDocument();

            xlfDocument.Load(inputFile);

            XmlNode xmlEptNode = xlfDocument.SelectNodes("//ept").Item(eptPosition);
            Ept     eptElement = new Ept(xmlEptNode);

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

            /* Set of Assertions. */
            Assert.IsNotNull(auxiliaryAttribute);
            Assert.AreEqual(expectedValue, auxiliaryAttribute.Value);
            Assert.AreEqual(auxiliaryAttribute, eptElement.GetCrcAttribute());
        }
Beispiel #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 = "";
            }
        }
Beispiel #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
            {
            }
        }