Ejemplo n.º 1
0
 [PlatformSpecific(PlatformID.Windows)] // device names
 public void PathWithReservedDeviceNameAsPath_ReturnsFalse()
 {
     Assert.All((IOInputs.GetPathsWithReservedDeviceNames()), (component) =>
     {
         Assert.False(Exists(component));
     });
 }
Ejemplo n.º 2
0
        [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));
            });
        }
Ejemplo n.º 3
0
    [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);
        }
    }
Ejemplo n.º 4
0
    [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);
            });
        }
    }