-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZipExtensionWrapper class added with unit tests.
- Loading branch information
1 parent
1d9b7b9
commit 5e178be
Showing
3 changed files
with
776 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.IO.Abstractions; | ||
using System.IO.Compression; | ||
|
||
namespace DataAccess.Extensions; | ||
/// <inheritdoc cref="ZipExtension"/> | ||
public class ZipExtensionWrapper | ||
{ | ||
/// <summary> | ||
/// Gets the file system used by this wrapper. | ||
/// </summary> | ||
public IFileSystem FileSystem { get; private set; } | ||
|
||
|
||
public ZipExtensionWrapper(IFileSystem fileSystem) | ||
{ | ||
FileSystem = fileSystem; | ||
} | ||
|
||
/// <inheritdoc cref="ZipExtension.GetZipArchive"/> | ||
public ZipArchive GetZipArchive(string archivePath) | ||
{ | ||
return ZipExtensions.GetZipArchive(FileSystem, archivePath); | ||
} | ||
|
||
/// <inheritdoc cref="ZipExtension.ExtractToDirectory"/> | ||
public void ExtractToDirectory(ZipArchive archive, string destination) | ||
{ | ||
ZipExtensions.ExtractToDirectory(archive, FileSystem, destination); | ||
} | ||
|
||
/// <inheritdoc cref="ZipExtension.CreateFromDirectoryAsync"/> | ||
public async Task CreateFromDirectoryAsync(string sourcePath, string destinationPath) | ||
{ | ||
await ZipExtensions.CreateFromDirectoryAsync(FileSystem, sourcePath, destinationPath); | ||
} | ||
} |
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
Oops, something went wrong.