Beispiel #1
0
        public void TET_Struc_AddRemovedTreeIntoList()
        {
            var list = new FolderList
            {
                new Folder
                {
                    TreeChildren =
                    {
                        new Folder
                        {
                            TreeChildren =
                            {
                                new Folder(),
                                new Folder(),
                            }
                        },
                        new Folder(),
                    }
                }
            };
            list.MarkSaved();

            var root = list[0];
            list.Clear();

            (root as ITreeComponent).EachNode(c =>
            {
                Assert.IsTrue(c.IsDeleted);
                return false;
            });

            list.Add(root);

            (root as ITreeComponent).EachNode(c =>
            {
                Assert.IsFalse(c.IsDeleted);
                return false;
            });
        }
Beispiel #2
0
        public void TET_Struc_RemoveTree_Status_Clear()
        {
            var list = new FolderList
            {
                new Folder
                {
                    TreeChildren =
                    {
                        new Folder(),
                        new Folder(),
                    }
                }
            };
            list.MarkSaved();

            var root = list[0];

            list.Clear();

            Assert.AreEqual(list.Count, 0);
            Assert.AreEqual(list.DeletedList.Count, 1);
            Assert.IsTrue(root.IsDeleted);
            Assert.IsTrue(root.TreeChildren[0].IsDeleted);
            Assert.IsTrue(root.TreeChildren[1].IsDeleted);
        }