예제 #1
0
        public void CanFailToCopyDirectoryIfThereIsNoSpaceToCopy()
        {
            if (TargetVolume.Capacity == Volume.INFINITE_CAPACITY)
            {
                Assert.Pass();
                return;
            }

            (SourceVolume.Open(subsubdir1File1Path) as VolumeFile)
            .WriteLn(new string('a', (int)TargetVolume.Capacity / 4 + 1));
            SourceVolume.CreateFile(subdir1Path.Combine("other"))
            .WriteLn(new string('a', (int)TargetVolume.Capacity / 4 + 1));
            Assert.IsTrue(volumeManager.Copy(subdir1Path, GlobalPath.FromString("1:/copy1")));
            Assert.IsFalse(volumeManager.Copy(subdir1Path, GlobalPath.FromString("1:/copy2")));
        }
예제 #2
0
        public void SetupVolumes()
        {
            dir1Path       = GlobalPath.FromString("0:" + dir1);
            subdir1Path    = dir1Path.Combine(subdir1);
            subdir2Path    = dir1Path.Combine(subdir2);
            subsubdir1Path = subdir1Path.Combine(subsubdir1);

            file1Path           = GlobalPath.FromString("0:" + file1);
            dir1File1Path       = dir1Path.Combine(file1);
            dir1File2Path       = dir1Path.Combine(file2);
            dir1File3Path       = dir1Path.Combine(file3);
            subdir1File1Path    = subdir1Path.Combine(file1);
            subsubdir1File1Path = subsubdir1Path.Combine(file1);

            SourceVolume.Clear();
            TargetVolume.Clear();

            SourceVolume.CreateDirectory(subdir2Path);
            SourceVolume.CreateDirectory(subsubdir1Path);

            SourceVolume.CreateFile(file1Path).WriteLn(file1);
            SourceVolume.CreateFile(dir1File3Path).WriteLn(file2);
            SourceVolume.CreateFile(subsubdir1File1Path).WriteLn("subsubdir1File1");
        }