TransformDirectory() public method

Transform a windows directory name according to the Zip file naming conventions.
public TransformDirectory ( string name ) : string
name string The directory name to transform.
return string
Ejemplo n.º 1
0
        public void NameTransforms()
        {
            INameTransform t = new ZipNameTransform(@"C:\Slippery");
            Assert.AreEqual("Pongo/Directory/", t.TransformDirectory(@"C:\Slippery\Pongo\Directory"), "Value should be trimmed and converted");
            Assert.AreEqual("PoNgo/Directory/", t.TransformDirectory(@"c:\slipperY\PoNgo\Directory"), "Trimming should be case insensitive");
            Assert.AreEqual("slippery/Pongo/Directory/", t.TransformDirectory(@"d:\slippery\Pongo\Directory"), "Trimming should be case insensitive");

            Assert.AreEqual("Pongo/File", t.TransformFile(@"C:\Slippery\Pongo\File"), "Value should be trimmed and converted");
        }
Ejemplo n.º 2
0
 public void TooLong()
 {
     ZipNameTransform zt = new ZipNameTransform();
     string veryLong = new string('x', 65536);
     try {
         zt.TransformDirectory(veryLong);
         Assert.Fail("Expected an exception");
     }
     catch (PathTooLongException) {
     }
 }
Ejemplo n.º 3
0
 public void LengthBoundaryOk()
 {
     ZipNameTransform zt = new ZipNameTransform();
     string veryLong = "c:\\" + new string('x', 65535);
     try {
         zt.TransformDirectory(veryLong);
     }
     catch {
         Assert.Fail("Expected no exception");
     }
 }