[PlatformSpecific(PlatformID.Windows)] // testing drive labels public void SubdirectoryOnNonExistentDriveAsPath_ThrowsDirectoryNotFoundException() { Assert.Throws <DirectoryNotFoundException>(() => { Create(Path.Combine(IOServices.GetNonExistentDrive(), "Subdirectory")); }); }
[PlatformSpecific(PlatformID.Windows)] // testing drive labels public void NonExistentDriveAsPath_ThrowsDirectoryNotFoundException() { Assert.Throws <DirectoryNotFoundException>(() => { Create(IOServices.GetNonExistentDrive()); }); }
[PlatformSpecific(TestPlatforms.Windows)] // drive labels public void ExtendedDriveAsPath() { Assert.False(Exists(IOInputs.ExtendedPrefix + IOServices.GetNonExistentDrive())); if (PlatformDetection.IsNotInAppContainer) { Assert.Contains(IOServices.GetReadyDrives(), drive => Exists(IOInputs.ExtendedPrefix + drive)); } }
[PlatformSpecific(PlatformID.Windows)] // drive labels public static void Exists_SubdirectoryOnNonExistentDriveAsPath_ReturnsFalse() { var drive = IOServices.GetNonExistentDrive(); if (drive == null) { Console.WriteLine("Skipping test. Unable to find a non-existent drive."); return; } bool result = Directory.Exists(Path.Combine(drive, "Subdirectory")); Assert.False(result); }
[PlatformSpecific(PlatformID.Windows)] // testing drive labels public static void CreateDirectory_SubdirectoryOnNonExistentDriveAsPath_ThrowsDirectoryNotFoundException() { var drive = IOServices.GetNonExistentDrive(); if (drive == null) { Console.WriteLine("Skipping test. Unable to find a non-existent drive."); return; } Assert.Throws <DirectoryNotFoundException>(() => { Directory.CreateDirectory(Path.Combine(drive, "Subdirectory")); }); }
[PlatformSpecific(TestPlatforms.Windows)] // drive labels public void SubdirectoryOnNonExistentDriveAsPath_ReturnsFalse() { Assert.False(Exists(Path.Combine(IOServices.GetNonExistentDrive(), "nonexistentsubdir"))); }
[PlatformSpecific(TestPlatforms.Windows)] // drive labels public void DriveAsPath() { Assert.False(Exists(IOServices.GetNonExistentDrive())); Assert.Contains(IOServices.GetReadyDrives(), drive => Exists(drive)); }
[PlatformSpecific(TestPlatforms.Windows)] // drive labels public void NonExistentDriveAsPath_ReturnsFalse() { Assert.False(Exists(IOServices.GetNonExistentDrive())); }
[PlatformSpecific(TestPlatforms.Windows)] // drive labels public void ExtendedDriveAsPath() { Assert.False(Exists(IOInputs.ExtendedPrefix + IOServices.GetNonExistentDrive())); Assert.Contains(IOServices.GetReadyDrives(), drive => Exists(IOInputs.ExtendedPrefix + drive)); }
public static string GetUnusedDrive() { return(IOServices.GetNonExistentDrive()); }