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); }
public void First_Test_1() { string testBptEptRaw = "<source><bpt id=\"1\"><cf font=\"Arial\" asiantextfont=\"Arial\" complexscriptsfont=\"Arial\" size=\"9\" complexscriptssize=\"9\"></bpt>Otis Proprietary & Confidential – for internal distribution only<ept id=\"1\"></cf></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 & Confidential – for internal distribution only", tr.listOfBptEpt[0].TextBetween); }
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 & Confidential – for internal distribution only", elementConstructor.listOfBptEpt[0].TextBetween); Assert.AreEqual("<cf font=\"Arial\" asiantextfont=\"Arial\" complexscriptsfont=\"Arial\" size=\"9\" complexscriptssize=\"9\">", elementConstructor.listOfBptEpt[0].BptElement.Content); Assert.AreEqual("</cf>", elementConstructor.listOfBptEpt[0].EptElement.Content); }
/* 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); } } }
/* 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); } } } }