Esempio n. 1
0
        public void TransUnitElements_Parsing_Test_2()
        {
            TransUnitElements elementConstructor = new TransUnitElements(TestString0);

            Assert.AreEqual(0, elementConstructor.listOfBptEpt.Count);
            Assert.AreEqual(0, elementConstructor.listOfIt.Count);
            Assert.AreEqual(0, elementConstructor.listOfPh.Count);

            Assert.AreEqual(0, elementConstructor.listBptNotPairedIDs.Count);
            Assert.AreEqual(0, elementConstructor.listEptNotPairedIDs.Count);
        }
Esempio n. 2
0
        public void First_Test_1()
        {
            string            testBptEptRaw = "<source><bpt id=\"1\">&lt;cf font=\"Arial\" asiantextfont=\"Arial\" complexscriptsfont=\"Arial\" size=\"9\" complexscriptssize=\"9\"&gt;</bpt>Otis Proprietary &amp; Confidential – for internal distribution only<ept id=\"1\">&lt;/cf&gt;</ept></source>";
            TransUnitElements tr            = new TransUnitElements(testBptEptRaw);

            Assert.AreEqual(1, tr.listOfBpt.Count);
            Assert.AreEqual(1, tr.listOfEpt.Count);

            Assert.AreEqual(1, tr.listOfBptEpt.Count);
            Assert.AreEqual("Otis Proprietary &amp; Confidential – for internal distribution only", tr.listOfBptEpt[0].TextBetween);
        }
Esempio n. 3
0
        public void TransUnitElements_Parsing_Test_1()
        {
            TransUnitElements elementConstructor = new TransUnitElements(TestString1);

            Assert.AreEqual(1, elementConstructor.listOfBptEpt.Count);
            Assert.AreEqual(0, elementConstructor.listOfIt.Count);
            Assert.AreEqual(0, elementConstructor.listOfPh.Count);

            Assert.AreEqual(0, elementConstructor.listBptNotPairedIDs.Count);
            Assert.AreEqual(0, elementConstructor.listEptNotPairedIDs.Count);

            Assert.AreEqual("Otis Proprietary &amp; Confidential – for internal distribution only", elementConstructor.listOfBptEpt[0].TextBetween);
            Assert.AreEqual("&lt;cf font=\"Arial\" asiantextfont=\"Arial\" complexscriptsfont=\"Arial\" size=\"9\" complexscriptssize=\"9\"&gt;", elementConstructor.listOfBptEpt[0].BptElement.Content);
            Assert.AreEqual("&lt;/cf&gt;", elementConstructor.listOfBptEpt[0].EptElement.Content);
        }
Esempio n. 4
0
        /* Constructors */

        public Target(XmlNode xmlNodeContainingTarget)
        {
            if (xmlNodeContainingTarget.SelectSingleNode("./target") != null)
            {
                parsingSuccess = true;
                xmlNode        = xmlNodeContainingTarget.SelectSingleNode("./target");

                outerXml  = xmlNode.OuterXml;
                innerXml  = xmlNode.InnerXml;
                innerText = xmlNode.InnerText;

                if (innerXml.Length != 0)
                {
                    targetElements = new TransUnitElements(innerXml);
                }
            }
        }
Esempio n. 5
0
        /* Methods */

        /* Constructors */

        public Source(XmlNode xmlNodeContainingSource)
        {
            if (xmlNodeContainingSource.InnerXml.Contains("<source>") && xmlNodeContainingSource.InnerXml.Contains("</source>"))
            {
                if ((xmlNode = xmlNodeContainingSource.SelectSingleNode("./source")) != null)
                {
                    parsingSuccess = true;

                    outerXml  = xmlNode.OuterXml;
                    innerXml  = xmlNode.InnerXml;
                    innerText = xmlNode.InnerText;

                    if (innerXml.Length != 0)
                    {
                        sourceElements = new TransUnitElements(innerXml);
                    }
                }
            }
        }