コード例 #1
0
ファイル: GenericFolderTests.cs プロジェクト: anelson/infohub
        public void MoveNullTest()
        {
            //attempt to move a folder a null folder
            //That is not permitted
            GenericFolder folder = new GenericFolder(_root, "Bar");

            folder.Move(null);
        }
コード例 #2
0
ファイル: GenericFolderTests.cs プロジェクト: anelson/infohub
        public void MoveTest()
        {
            GenericFolder folder1 = new GenericFolder(_root, "Bar");
            GenericFolder folder2 = new GenericFolder(_root, "Baz");
            GenericFolder folder3 = new GenericFolder(folder2, "Boo");

            Assert.AreEqual(2, _root.Children.Count);
            Assert.AreEqual(0, folder1.Children.Count);
            Assert.AreEqual(1, folder2.Children.Count);
            Assert.AreEqual(0, folder3.Children.Count);

            Assert.AreEqual(_root, folder1.ParentFolder);
            Assert.AreEqual(_root, folder2.ParentFolder);
            Assert.AreEqual(folder2, folder3.ParentFolder);

            Assert.AreEqual(Path.Combine(folder2.Path, folder3.Name), folder3.Path);
            folder3.Move(folder1);
            Assert.AreEqual(Path.Combine(folder1.Path, folder3.Name), folder3.Path);

            Assert.AreEqual(2, _root.Children.Count);
            Assert.AreEqual(1, folder1.Children.Count);
            Assert.AreEqual(0, folder2.Children.Count);
            Assert.AreEqual(0, folder3.Children.Count);

            Assert.AreEqual(_root, folder1.ParentFolder);
            Assert.AreEqual(_root, folder2.ParentFolder);
            Assert.AreEqual(folder1, folder3.ParentFolder);
        }
コード例 #3
0
ファイル: GenericFolderTests.cs プロジェクト: anelson/infohub
 public void MoveBogusIdxTest()
 {
     //attempt to move to a bogus idx at a parent
     //That is not permitted
     GenericFolder folder = new GenericFolder(_root, "Bar");
     GenericFolder folder2 = new GenericFolder(_root, "Folder2");
     folder.Move(folder2, 10);
 }