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"))); }
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"))); }
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"))); }