[PlatformSpecific(PlatformID.Windows)] // device names public void PathWithReservedDeviceNameAsPath_ReturnsFalse() { Assert.All((IOInputs.GetPathsWithReservedDeviceNames()), (component) => { Assert.False(Exists(component)); }); }
[PlatformSpecific(PlatformID.Windows)] // device name prefixes public void PathWithReservedDeviceNameAsPath_ThrowsDirectoryNotFoundException() { // Throws DirectoryNotFoundException, when the behavior really should be an invalid path var paths = IOInputs.GetPathsWithReservedDeviceNames(); Assert.All(paths, (path) => { Assert.Throws <DirectoryNotFoundException>(() => Create(path)); }); }
[PlatformSpecific(PlatformID.Windows)] // device names public static void Exists_PathWithReservedDeviceNameAsPath_ReturnsFalse() { var paths = IOInputs.GetPathsWithReservedDeviceNames(); foreach (var path in paths) { bool result = Directory.Exists(path); Assert.False(result, path); } }
[PlatformSpecific(PlatformID.Windows)] // device name prefixes public static void CreateDirectory_PathWithReservedDeviceNameAsPath_ThrowsDirectoryNotFoundException() { // Throws DirectoryNotFoundException, when the behavior really should be an invalid path var paths = IOInputs.GetPathsWithReservedDeviceNames(); foreach (var path in paths) { Assert.Throws <DirectoryNotFoundException>(() => { Directory.CreateDirectory(path); }); } }