Created
November 21, 2009 00:22
-
-
Save dvhthomas/239909 to your computer and use it in GitHub Desktop.
Testing the 7zip implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Compressing_file_in_non_working_directory_zips_the_right_files() | |
{ | |
const string zipFile = "archive.7z"; | |
const string fileToCompress = "sample.jpg"; | |
DirectoryInfo directoryInfo = new DirectoryInfo(@"..\..\..\..\"); | |
Console.Write(directoryInfo.FullName); | |
Assert.IsTrue(directoryInfo.Exists); | |
FileInfo zipTarget = new FileInfo(Path.Combine(directoryInfo.FullName, zipFile)); | |
IFileZipUtility zipper = new FileZipUtility(new SevenZip()); | |
zipper.GenerateZipFile(zipTarget.FullName, new FileInfo(Path.Combine(directoryInfo.FullName, fileToCompress))); | |
var exists = zipTarget.Exists; | |
Assert.IsTrue(exists); | |
zipTarget.Delete(); | |
} | |
/// <summary> | |
/// Setup that happens before any test run in this fixture | |
/// </summary> | |
[TestFixtureSetUp] | |
public void SetupFixture() | |
{ | |
ILogFactory logFactory = new Logging.NLog.NLogFactory(); | |
Log.InitializeLogFactory(logFactory); | |
this._utility = new FileZipUtility(new SevenZip(_sevenZipPath)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment