예제 #1
0
        public void CanMoveDirectoryToRootDirectory()
        {
            GlobalPath targetPath = GlobalPath.FromString("1:");

            Assert.IsTrue(volumeManager.Move(dir1Path, targetPath));
            Assert.IsFalse(SourceVolume.Exists(dir1Path));
        }
예제 #2
0
        public void CanMoveFileByCookedName()
        {
            var        sourcePath = dir1Path.Combine("file3");
            GlobalPath targetPath = GlobalPath.FromString("1:");

            Assert.IsTrue(volumeManager.Move(sourcePath, targetPath));

            Assert.IsFalse(SourceVolume.Exists(sourcePath));
            Assert.AreEqual(1, TargetVolume.Root.List().Count);
            Assert.IsTrue(TargetVolume.Root.List()[file3] is VolumeFile);
        }
예제 #3
0
        public void CanMoveFileToNewFile()
        {
            Assert.IsTrue(volumeManager.Move(subsubdir1File1Path, GlobalPath.FromString("1:/dir1/file1")));

            Assert.IsFalse(SourceVolume.Exists(subsubdir1File1Path));
            Assert.AreEqual(1, TargetVolume.Root.List().Count);
            VolumeDirectory parent = (TargetVolume.Open(dir1Path) as VolumeDirectory);

            Assert.AreEqual(1, parent.List().Count);
            Assert.AreEqual("subsubdir1File1\n", (parent.List()[file1] as VolumeFile).ReadAll().String);
        }
예제 #4
0
 public void CanMoveDirectoryToExistingDirectory()
 {
     TargetVolume.CreateDirectory(VolumePath.FromString("/newdirectory"));
     Assert.IsTrue(volumeManager.Move(dir1Path, GlobalPath.FromString("1:/newdirectory")));
     Assert.IsFalse(SourceVolume.Exists(dir1Path));
 }