-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZipExtensionWrapper class added with unit tests. #693
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12946571648Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
778c366
to
5e178be
Compare
CreateFromDirectoryAsync_NoWritePermission_ThrowsUnauthorizedAccessException updated with NSubstitute.
This reverts commit 1e59c91.
Fix von CreateFromDirectoryAsync_NoWritePermission_ThrowsUnauthorizedAccessException() test using NSubstitute.
|
||
namespace DataAccessTest.Extensions; | ||
[TestFixture] | ||
public class ZipExtensionUnitTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sollte dann ZipExtensionsWrapperUt heißen.
{ | ||
_mockFileSystem = new MockFileSystem(); | ||
} | ||
public ZipExtensionWrapper CreateZipExtensionWrapper(IFileSystem? fileSystem = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kann private sein.
|
||
namespace DataAccess.Extensions; | ||
/// <inheritdoc cref="ZipExtension"/> | ||
public class ZipExtensionWrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Da die Klasse, auf die sich der Wrapper bezieht ZipExtensions heißt, sollte auch der Wrapper ZipExtensionsWrapper heißen.
FileSystem = fileSystem; | ||
} | ||
|
||
/// <inheritdoc cref="ZipExtension.GetZipArchive"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die doc kann nicht einfach so übernommen werden, da es den Parameter für das FileSystem im Wrapper nicht mehr gibt.
return memoryStream; | ||
} | ||
|
||
private static MemoryStream CreateMemmoryStreamWithZipArchive() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*CreateMemoryStreamWithZipArchive()
/// Implementing tested with OpenRead. It would be better if a mock file would be constructed using the TestingHelpers that we are not allowed to access. | ||
/// </summary> | ||
[Test] | ||
public void GetZipArchiveAccessIsDenied_ThrowsUnauthorizedAccessException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*GetZipArchive_AccessIsDenied_ThrowsUnauthorizedAccessException()
Besser lesbar, da die zu testende Methode vor dem ersten Unterstrich steht.
/// Implementing tested with OpenRead. It would be better if a mock file would be constructed using the TestingHelpers that we are not allowed to access. | ||
/// </summary> | ||
[Test] | ||
public void GetZipArchiveFileCannotBeRead_ThrowsIOException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*GetZipArchive_FileCannotBeRead_ThrowsIOException()
@@ -0,0 +1,648 @@ | |||
using DataAccess.Extensions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests, die aus plattformspezifischen Gründen fehlschlagen, müssen mit einer plattformunabhängigen Möglichkeit, Pfade zu erstellen, überarbeitet werden.
Pfade in den Tests müssen in Abhängigkeit des aktuellen Betriebssystems erstellt werde.
Zu finden in DataAccess/Extensions/ZipExtensionWrapper