public void XLF_GetTransUnitNodeByID_Xliff3_Test_4() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath3); XLF testXLF = new XLF(xlfDocument); int auxiliaryNumber = 0; TransUnitNode auxiliaryTransUnitNode; /* Set of Assertions. */ for (int i = 0; i < testXLF.TransUnitDoublyLinkedList.Count; i++) { auxiliaryTransUnitNode = testXLF.GetTransUnitNode(i); if (auxiliaryTransUnitNode.Data.DoesHaveNumericalID == false) { auxiliaryNumber++; } if (auxiliaryTransUnitNode.Data.DoesHaveNumericalID) { Assert.AreEqual(i - auxiliaryNumber, auxiliaryTransUnitNode.Data.ID - 1); } if (auxiliaryTransUnitNode == null) { Assert.Fail("Trans Unit node of id = {0} is null.", i); } } }
public void XLF_GetTransUnitNodeByID_Xliff1_Test_2() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath); XLF testXLF = new XLF(xlfDocument); TransUnitNode auxiliaryTransUnitNode = testXLF.GetTransUnitNodeByID(0); /* Set of Assertions. */ Assert.IsNull(auxiliaryTransUnitNode); }
public void XLF_GetTransUnitNodeByID_Xliff1_Test_1() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath); XLF testXLF = new XLF(xlfDocument); TransUnitNode auxiliaryTransUnitNode = testXLF.GetTransUnitNodeByID(1); /* Set of Assertions. */ Assert.AreEqual(1, auxiliaryTransUnitNode.Data.ID); }
public void XLF_Constructor_Xliff3_Test_3() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath3); XLF testXLF = new XLF(xlfDocument); /* Set of Assertions. */ Assert.IsTrue(testXLF.IsParsedCorrectly); Assert.AreEqual(125, testXLF.TransUnitDataList.Count); Assert.AreEqual(125, testXLF.TransUnitDoublyLinkedList.Count); }
public void XLF_Constructor_Xliff1_Test_1() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath); XLF testXLF = new XLF(xlfDocument); /* Set of Assertions. */ Assert.IsTrue(testXLF.IsParsedCorrectly); // As count of trans unit is different that count of doulbyLinkedList and because one of the elements is null. Assert.AreEqual(169, testXLF.TransUnitDataList.Count); Assert.AreEqual(169, testXLF.TransUnitDoublyLinkedList.Count); }
public void XLF_GetNextTranslatableNode_Xliff1_Test_3() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath3); XLF testXLF = new XLF(xlfDocument); TransUnitNode auxiliaryTransUnitNode = testXLF.GetTransUnitNodeByID(125); TransUnitNode nextTranslatableNode = testXLF.GetNextTranslatableNode(auxiliaryTransUnitNode); /* Set of Assertions. */ Assert.IsNull(nextTranslatableNode); }
public void XLF_GetPreviousTranslatableNode_Universal_Test_1() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath); XLF testXLF = new XLF(xlfDocument); TransUnitNode auxiliaryTransUnitNode = null; TransUnitNode previousTranslatableNode = testXLF.GetPreviousTranslatableNode(auxiliaryTransUnitNode); /* Set of Assertions. */ Assert.IsNull(previousTranslatableNode); }
public void XLF_GetNextTranslatableNode_Xliff3_Test_1() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath3); XLF testXLF = new XLF(xlfDocument); TransUnitNode auxiliaryTransUnitNode = testXLF.GetTransUnitNodeByID(1); TransUnitNode nextTranslatableNode = testXLF.GetNextTranslatableNode(auxiliaryTransUnitNode); /* Set of Assertions. */ Assert.IsTrue(nextTranslatableNode.Data.IsTranslatable); Assert.AreEqual(10, nextTranslatableNode.Data.ID); }
public void XLF_GetTransUnitNodeByID_Xliff3_Test_3() { /* Initialization. */ XmlDocument xlfDocument = new XmlDocument(); xlfDocument.Load(xliffPath3); XLF testXLF = new XLF(xlfDocument); int doublyLinkedListCount = testXLF.TransUnitDoublyLinkedList.Count; /* Set of Assertions. */ Assert.AreEqual(doublyLinkedListCount, testXLF.MaximalNumericalID + testXLF.NonNumericalIDCount); Assert.AreEqual("125", testXLF.GetTransUnitData(doublyLinkedListCount - 1).GeneralID); Assert.AreEqual(125, testXLF.GetTransUnitData(doublyLinkedListCount - 1).ID); }