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

            (SourceVolume.Open(subsubdir1File1Path) as VolumeFile)
            .WriteLn(new string('a', (int)SourceVolume.Capacity / 2 + 1));
            Assert.IsTrue(volumeManager.Move(subdir1Path, GlobalPath.FromString("0:/newname")));
        }
예제 #2
0
        public void CanFailToMoveWhenTheresNoSpaceOnTargetVolume()
        {
            if (TargetVolume.Capacity == Volume.INFINITE_CAPACITY)
            {
                Assert.Pass();
                return;
            }

            (SourceVolume.Open(subsubdir1File1Path) as VolumeFile)
            .WriteLn(new string('a', (int)TargetVolume.Capacity / 2 + 1));
            Assert.IsTrue(volumeManager.Copy(subdir1Path, GlobalPath.FromString("1:/copy1")));
            Assert.IsFalse(volumeManager.Move(subdir1Path, GlobalPath.FromString("1:/copy2")));
        }
예제 #3
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")));
        }