Ejemplo n.º 1
0
 [PlatformSpecific(PlatformID.Windows)] // max directory length not fixed on Unix
 public void DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse()
 {
     Assert.All((IOInputs.GetPathsWithComponentLongerThanMaxComponent()), (component) =>
     {
         Assert.False(Exists(component));
     });
 }
Ejemplo n.º 2
0
        public void DirectoryWithComponentLongerThanMaxComponentAsPath_ThrowsPathTooLongException()
        {
            // While paths themselves can be up to 260 characters including trailing null, file systems
            // limit each components of the path to a total of 255 characters.
            var paths = IOInputs.GetPathsWithComponentLongerThanMaxComponent();

            Assert.All(paths, (path) =>
            {
                Assert.Throws <PathTooLongException>(() => Create(path));
            });
        }
Ejemplo n.º 3
0
    [PlatformSpecific(PlatformID.Windows)] // max directory length not fixed on Unix
    public static void Exists_DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse()
    {
        var paths = IOInputs.GetPathsWithComponentLongerThanMaxComponent();

        foreach (string path in paths)
        {
            bool result = Directory.Exists(path);

            Assert.False(result, path);
        }
    }
Ejemplo n.º 4
0
    [PlatformSpecific(PlatformID.Windows)] // max component size not fixed on Unix
    public static void CreateDirectory_DirectoryWithComponentLongerThanMaxComponentAsPath_ThrowsPathTooLongException()
    {
        // While paths themselves can be up to 260 characters including trailing null, file systems
        // limit each components of the path to a total of 255 characters.

        var paths = IOInputs.GetPathsWithComponentLongerThanMaxComponent();

        foreach (string path in paths)
        {
            Assert.Throws <PathTooLongException>(() =>
            {
                Directory.CreateDirectory(path);
            });
        }
    }