public void CanMoveDirectoryToRootDirectory() { GlobalPath targetPath = GlobalPath.FromString("1:"); Assert.IsTrue(volumeManager.Move(dir1Path, targetPath)); Assert.IsFalse(SourceVolume.Exists(dir1Path)); }
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); }
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); }
public void CanMoveDirectoryToExistingDirectory() { TargetVolume.CreateDirectory(VolumePath.FromString("/newdirectory")); Assert.IsTrue(volumeManager.Move(dir1Path, GlobalPath.FromString("1:/newdirectory"))); Assert.IsFalse(SourceVolume.Exists(dir1Path)); }