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); }
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); }
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)); }
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); }
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); }
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()); }
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 = ""; } }
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 { } }