public void MoveNullTest()
 {
     //attempt to move to a null parent
     //That is not permitted
     GenericContentContainer contain = new GenericContentContainer(_doc);
     contain.Move(null);
 }
        public void GenericEmptyTest()
        {
            GenericContentContainer contain = new GenericContentContainer(_doc);

            Assert.AreEqual(1, _doc.Children.Count);
            Assert.AreEqual(_doc, contain.FileSystemParent);
        }
 public void MoveBogusIdxTest()
 {
     //attempt to move to a bogus idx at a parent
     //That is not permitted
     GenericContentContainer contain = new GenericContentContainer(_doc);
     GenericDocument doc2 = new GenericDocument(_parent, "Doc1", "text/plain");
     contain.Move(doc2, 10);
 }
 public void AddUnrelatedObjectTest()
 {
     //Add a content object to the container's Children list that
     //has a Parent other than the container
     GenericContentContainer contain = new GenericContentContainer(_doc);
     GenericContentObject notMine = new GenericContentObject(_doc);
     contain.Children.Add(notMine);
 }
        public void AncestryTest()
        {
            GenericDocument doc1 = new GenericDocument(_parent, "Doc1", "text/plain");
            GenericDocument doc2 = new GenericDocument(_parent, "Doc2", "text/plain");
            GenericContentContainer contain = new GenericContentContainer(doc1);

            //The root folder is the ancestor of everyone
            Assert.IsTrue(_root.IsAncestorOf(contain.FileSystemParent));

            //And everyone is the descendent of the root folder
            Assert.IsTrue(contain.FileSystemParent.IsDescendentOf(_root));
        }
        public void MoveTest()
        {
            GenericDocument doc1 = new GenericDocument(_parent, "Doc1", "text/plain");
            GenericDocument doc2 = new GenericDocument(_parent, "Doc2", "text/plain");
            GenericContentContainer contain = new GenericContentContainer(doc1);

            Assert.AreEqual(1, doc1.Children.Count);
            Assert.AreEqual(0, doc2.Children.Count);

            Assert.AreEqual(doc1, contain.Parent);
            Assert.AreEqual(doc1, contain.FileSystemParent);

            //Move obj from doc1 to doc2
            contain.Changed += new ContentObjectChangedEventHandler(contain_Changed);
            contain.Move(doc2);
            contain.Changed -= new ContentObjectChangedEventHandler(contain_Changed);
            Assert.AreEqual(true, contain.PropertyBag["contain_Changed.fired"]);
            Assert.AreEqual(0, doc1.Children.Count);
            Assert.AreEqual(1, doc2.Children.Count);

            Assert.AreEqual(doc2, contain.Parent);
            Assert.AreEqual(doc2, contain.FileSystemParent);
        }
 public void NullParentTest()
 {
     GenericContentContainer contain = new GenericContentContainer(null);
 }
Ejemplo n.º 8
0
 public void MoveNonFolderTest()
 {
     //attempt to move to an object that isn't a folder
     //That is not permitted
     GenericDocument doc = new GenericDocument(_parent, "Foo", "text/plain");
     GenericDocument doc2 = new GenericDocument(_parent, "Foo", "text/plain");
     GenericContentContainer notMine = new GenericContentContainer(doc2);
     doc.Move(notMine);
 }
Ejemplo n.º 9
0
        public void MoveTest()
        {
            GenericDocument doc1 = new GenericDocument(_parent, "Doc1", "text/plain");
            GenericDocument doc2 = new GenericDocument(_parent, "Doc2", "text/plain");
            GenericContentContainer contain = new GenericContentContainer(doc1);
            GenericContentObject obj = new GenericContentObject(contain);

            Assert.AreEqual(1, doc1.Children.Count);
            Assert.AreEqual(1, contain.Children.Count);
            Assert.AreEqual(0, doc2.Children.Count);

            Assert.AreEqual(contain, obj.Parent);
            Assert.AreEqual(doc1, obj.FileSystemParent);
            Assert.AreEqual(doc1, contain.Parent);

            //Move obj from doc1 to doc2
            contain.Move(doc2);
            Assert.AreEqual(0, doc1.Children.Count);
            Assert.AreEqual(1, doc2.Children.Count);

            Assert.AreEqual(contain, obj.Parent);
            Assert.AreEqual(doc2, obj.FileSystemParent);
            Assert.AreEqual(doc2, contain.Parent);
        }