Exemple #1
0
        public void AddSumNode()
        {
            var xmlDoc = new XmlDocument(TestUtility.CreateDefaultNSM().NameTable);

            xmlDoc.LoadXml(
                $@"<rowItems xmlns=""http://schemas.openxmlformats.org/spreadsheetml/2006/main"" count=""3"">
				<i>
					<x v=""1""/>
				</i>
				<i r=""1"">
					<x v=""2""/>
				</i>
				<i r=""1"">
					<x v=""3""/>
				</i>
			</rowItems>"            );
            var node            = xmlDoc.FirstChild;
            var itemsCollection = new ItemsCollection(TestUtility.CreateDefaultNSM(), node);

            itemsCollection.AddSumNode("grand");
            Assert.AreEqual(4, itemsCollection.Count);
            Assert.AreEqual(4, node.ChildNodes.Count);
            Assert.AreEqual("grand", itemsCollection[3].ItemType);
        }