[PlatformSpecific(PlatformID.Windows)] // max directory length not fixed on Unix public void DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse() { Assert.All((IOInputs.GetPathsWithComponentLongerThanMaxComponent()), (component) => { Assert.False(Exists(component)); }); }
public void DirectoryWithComponentLongerThanMaxComponentAsPath_ThrowsPathTooLongException() { // While paths themselves can be up to 260 characters including trailing null, file systems // limit each components of the path to a total of 255 characters. var paths = IOInputs.GetPathsWithComponentLongerThanMaxComponent(); Assert.All(paths, (path) => { Assert.Throws <PathTooLongException>(() => Create(path)); }); }
[PlatformSpecific(PlatformID.Windows)] // max directory length not fixed on Unix public static void Exists_DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse() { var paths = IOInputs.GetPathsWithComponentLongerThanMaxComponent(); foreach (string path in paths) { bool result = Directory.Exists(path); Assert.False(result, path); } }
[PlatformSpecific(PlatformID.Windows)] // max component size not fixed on Unix public static void CreateDirectory_DirectoryWithComponentLongerThanMaxComponentAsPath_ThrowsPathTooLongException() { // While paths themselves can be up to 260 characters including trailing null, file systems // limit each components of the path to a total of 255 characters. var paths = IOInputs.GetPathsWithComponentLongerThanMaxComponent(); foreach (string path in paths) { Assert.Throws <PathTooLongException>(() => { Directory.CreateDirectory(path); }); } }