示例#1
0
        public void AddTask()
        {
            var tx = new PertTask {
                Name = "Task x"
            };

            project.AddTask(tx);
            tx.LinkToAncestor(task10);

            CollectionAssert.Contains(project.Tasks, tx);
        }
        public void LinkAncestor()
        {
            var t1 = new PertTask {
                Name = "Task 1"
            };
            var t2 = new PertTask {
                Name = "Task 2"
            };

            t2.LinkToAncestor(t1);

            Assert.IsTrue(t1.Descendants.Contains(t2));
            Assert.IsTrue(t2.Ancestors.Contains(t1));
        }
 public void NoAncestorOfSelf()
 {
     Assert.Throws <ArgumentException>(() => { task5.LinkToAncestor(task5); });
     Assert.Throws <ArgumentException>(() => { task5.LinkToAncestor(task10); });
 }