Exemple #1
0
        public void GetFoldingItem()
        {
            FoldingCollection collection = new FoldingCollection();

            collection.Add(new FoldingItem(0, 10));
            collection.Add(new FoldingItem(1, 5));
            collection.Add(new FoldingItem(11, 12));
            FoldingItem item = collection.Get(2, 1);

            Assert.IsTrue(item.Start == 1 && item.End == 5);
        }
Exemple #2
0
        public void GetFoldingItems()
        {
            FoldingCollection collection = new FoldingCollection();

            collection.Add(new FoldingItem(0, 10));
            collection.Add(new FoldingItem(1, 5));
            collection.Add(new FoldingItem(11, 12));
            foreach (FoldingItem item in collection.GetRange(0, 10))
            {
                Assert.IsTrue((item.Start != 11 && item.End != 12));
            }
        }
Exemple #3
0
        public void GetFarestFoldingItem()
        {
            FoldingCollection collection = new FoldingCollection();
            FoldingItem       item       = new FoldingItem(0, 10);

            item.Expand = false;
            collection.Add(item);
            collection.Add(new FoldingItem(1, 5));
            collection.Add(new FoldingItem(11, 12));
            item = collection.GetFarestHiddenFoldingData(2, 1);
            Assert.IsTrue(item.Start == 0 && item.End == 10);
        }
Exemple #4
0
        public void HasParrentTest()
        {
            FoldingCollection collection = new FoldingCollection();
            FoldingItem       item       = new FoldingItem(0, 10, false);

            collection.Add(item);
            FoldingItem item1 = new FoldingItem(1, 5);

            collection.Add(item1);
            Assert.IsTrue(collection.IsHasParent(item1));
            Assert.IsTrue(!collection.IsHasParent(item));
        }
Exemple #5
0
        public void HiddenTest()
        {
            FoldingCollection collection = new FoldingCollection();

            collection.Add(new FoldingItem(0, 10, false));
            collection.Add(new FoldingItem(1, 5));
            Assert.IsTrue(collection.IsHidden(2));
            collection = new FoldingCollection();
            collection.Add(new FoldingItem(0, 10));
            collection.Add(new FoldingItem(1, 5, false));
            Assert.IsTrue(collection.IsHidden(2));
        }
Exemple #6
0
        public void CollapseFoldingItem()
        {
            FoldingCollection collection = new FoldingCollection();
            FoldingItem       newItem    = new FoldingItem(0, 10);

            collection.Add(newItem);
            collection.Add(new FoldingItem(1, 5));
            collection.Add(new FoldingItem(11, 12));
            collection.Collapse(newItem);
            foreach (FoldingItem item in collection.GetRange(0, 10))
            {
                Assert.IsFalse(item.Expand);
            }
        }
Exemple #7
0
        public void UpdateItems()
        {
            DummyRender render = new DummyRender();
            Document    doc    = new Document();

            doc.LayoutLines.Render = render;
            FoldingCollection collection = new FoldingCollection();

            collection.Add(new FoldingItem(0, 10));
            collection.Add(new FoldingItem(1, 5));
            collection.Add(new FoldingItem(15, 20));
            collection.Add(new FoldingItem(16, 17));
            collection.UpdateData(doc, 11, 1, 0);
            FoldingItem[] result = collection.GetRange(16, 4).ToArray();
            Assert.IsTrue((result[0].Start == 16 && result[0].End == 21));
            Assert.IsTrue((result[1].Start == 17 && result[1].End == 18));
            collection.UpdateData(doc, 11, 0, 1);
            result = collection.GetRange(16, 4).ToArray();
            Assert.IsTrue((result[0].Start == 15 && result[0].End == 20));
            Assert.IsTrue((result[1].Start == 16 && result[1].End == 17));
        }