public void NewFileSystemFolder() { using (var dir = new TempDirectory("Content.zip")) { var folder = FileSystemFactory.FileSystemInfoFromPath(dir.Location); Assert.IsInstanceOf <FileSystemFolder>(folder); } }
public void ZipNotFound(string path) { using (var dir = new TempDirectory()) { dir.CopyFileFromResources("Content.zip"); var fullPath = Path.Combine(dir.Location, path); Assert.Throws <IOException>(() => FileSystemFactory.FileSystemInfoFromPath(fullPath)); } }
public void NewFileSystemFile() { using (var dir = new TempDirectory()) { var fileName = Path.Combine(dir.Location, "11.txt"); File.WriteAllBytes(fileName, new byte[] { 1 }); var file = FileSystemFactory.FileSystemInfoFromPath(fileName); Assert.IsInstanceOf <FileSystemFile>(file); } }
public void NewZipFile(string fileName) { using (var dir = new TempDirectory()) { dir.CopyFileFromResources("Content.zip"); var file = FileSystemFactory.FileSystemInfoFromPath(Path.Combine(dir.Location, fileName)); Assert.IsInstanceOf <ZipFolderFile>(file); ((IFile)file).OpenRead().Dispose(); } }
public void NewZipFolder(string path, string fileName) { using (var dir = new TempDirectory()) { dir.CopyFileFromResources("Content.zip"); var folder = FileSystemFactory.FileSystemInfoFromPath(Path.Combine(dir.Location, path)); Assert.IsNotNull(folder); var files = ((IFolder)folder).GetFiles().ToList(); if (fileName != null) { Assert.AreEqual(1, files.Count); Assert.AreEqual(fileName, files[0].Name); } } }
public void NotFound(string path) { Assert.Throws <IOException>(() => FileSystemFactory.FileSystemInfoFromPath(path)); }