Questions tagged [zipunit]

ZipUnit is a small open-source .Net library for comparing zip files, aimed mainly at integration tests.

ZipUnit is a little .Net library for comparing zip files as part of integration tests. The code is available on GitHub.

Usage:

AssertThat.ZipFile("actual.zip").MatchesZipFile("expected.zip");

It is possible to ignore additional or missing files:

AssertThat.ZipFile("actual.zip").IgnoringAdditional(pattern1)
                                .IgnoringMissing(pattern2)
                                .MatchesZipFile("expected.zip");

where patterns look like the following:

"Dir/file.ext" //starts from the root of the zip file
"//Dir/file.ext" //starts from anywhere, like in an xPath
"Dir/*/file.ext" //Asterix (*) matches any substring (excluding the slash '/')
"Dir/file?.ext" //Question mark (?) matches one character (excluding the slash '/')
1 questions
1
vote
1 answer

Comparing zip files in C# for integration tests

I am writing some integration tests that need to compare a generated zip file containing mainly xml files with a baseline version. What is the easiest way to assert that two zip files contain the same files? One main requirement would be to produce…
Grzenio
  • 35,875
  • 47
  • 158
  • 240