예제 #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
파일: Exists.cs 프로젝트: yang73137/corefx
    [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());
 }