Exemplo n.º 1
0
        public void CheckForLeafChapterTest()
        {
            Assert.AreEqual(true, this.item.CheckForLeafChapter());
            Assert.Greater(this.item.Errors.Count, 0);

            ItemType item1 = ItemType.CreateNewItem("Item1", "Item1", null, PageType.Chapter);
            ItemType item2 = ItemType.CreateNewItem("Item2", "Item2", null, PageType.Theory);

            this.item.SubItems.Add(item1);
            Assert.AreEqual(false, this.item.CheckForLeafChapter());
            Assert.AreEqual(0, this.item.Errors.Count);

            this.item.RemoveChild(item1);

            this.item.SubItems.Add(item2);
            Assert.AreEqual(false, this.item.CheckForLeafChapter());
            Assert.AreEqual(0, this.item.Errors.Count);

            ItemType leafTheory = ItemType.CreateNewItem("Chapter", "Item3", null, PageType.Theory);

            Assert.AreEqual(false, leafTheory.CheckForLeafChapter());
        }