Esempio n. 1
0
        public void TabularDataNodePivotCacheId()
        {
            var node            = this.CreateTabularDataNode();
            var tabularDataNode = new TabularDataNode(node, ExcelSlicer.SlicerDocumentNamespaceManager);

            Assert.AreEqual("1", tabularDataNode.PivotCacheId);
            tabularDataNode.PivotCacheId = "2";
            Assert.AreEqual("2", tabularDataNode.PivotCacheId);
            Assert.AreEqual($@"<tabular pivotCacheId=""2"" xmlns=""{ExcelPackage.schemaMain2009}""><items count=""4""><i x=""0"" /><i x=""1"" /><i x=""2"" s=""1"" /><i x=""3"" s=""1"" /></items></tabular>", node.OuterXml);
        }
Esempio n. 2
0
        public void TabularDataNodeItems()
        {
            var node            = this.CreateTabularDataNode();
            var tabularDataNode = new TabularDataNode(node, ExcelSlicer.SlicerDocumentNamespaceManager);

            Assert.AreEqual(4, tabularDataNode.Items.Count);
            Assert.AreEqual(0, tabularDataNode.Items[0].AtomIndex);
            Assert.AreEqual(false, tabularDataNode.Items[0].IsSelected);
            Assert.AreEqual(1, tabularDataNode.Items[1].AtomIndex);
            Assert.AreEqual(false, tabularDataNode.Items[1].IsSelected);
            Assert.AreEqual(2, tabularDataNode.Items[2].AtomIndex);
            Assert.AreEqual(true, tabularDataNode.Items[2].IsSelected);
            Assert.AreEqual(3, tabularDataNode.Items[3].AtomIndex);
            Assert.AreEqual(true, tabularDataNode.Items[3].IsSelected);
        }