示例#1
0
 [PlatformSpecific(PlatformID.Windows)] // testing drive labels
 public void SubdirectoryOnNonExistentDriveAsPath_ThrowsDirectoryNotFoundException()
 {
     Assert.Throws <DirectoryNotFoundException>(() =>
     {
         Create(Path.Combine(IOServices.GetNonExistentDrive(), "Subdirectory"));
     });
 }
示例#2
0
 [PlatformSpecific(PlatformID.Windows)] // testing drive labels
 public void NonExistentDriveAsPath_ThrowsDirectoryNotFoundException()
 {
     Assert.Throws <DirectoryNotFoundException>(() =>
     {
         Create(IOServices.GetNonExistentDrive());
     });
 }
示例#3
0
文件: Exists.cs 项目: zhk0603/runtime
        [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));
            }
        }
示例#4
0
    [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);
    }
示例#5
0
    [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"));
        });
    }
示例#6
0
文件: Exists.cs 项目: zhk0603/runtime
 [PlatformSpecific(TestPlatforms.Windows)] // drive labels
 public void SubdirectoryOnNonExistentDriveAsPath_ReturnsFalse()
 {
     Assert.False(Exists(Path.Combine(IOServices.GetNonExistentDrive(), "nonexistentsubdir")));
 }
示例#7
0
文件: Exists.cs 项目: zhk0603/runtime
 [PlatformSpecific(TestPlatforms.Windows)]                                                   // drive labels
 public void DriveAsPath()
 {
     Assert.False(Exists(IOServices.GetNonExistentDrive()));
     Assert.Contains(IOServices.GetReadyDrives(), drive => Exists(drive));
 }
示例#8
0
 [PlatformSpecific(TestPlatforms.Windows)] // drive labels
 public void NonExistentDriveAsPath_ReturnsFalse()
 {
     Assert.False(Exists(IOServices.GetNonExistentDrive()));
 }
示例#9
0
 [PlatformSpecific(TestPlatforms.Windows)] // drive labels
 public void ExtendedDriveAsPath()
 {
     Assert.False(Exists(IOInputs.ExtendedPrefix + IOServices.GetNonExistentDrive()));
     Assert.Contains(IOServices.GetReadyDrives(), drive => Exists(IOInputs.ExtendedPrefix + drive));
 }
示例#10
0
 public static string GetUnusedDrive()
 {
     return(IOServices.GetNonExistentDrive());
 }