Beispiel #1
0
        public void ShouldReturnAByteArrayFromGeneratedFileZip()
        {
            // Arrange
            IDictionary <string, byte[]> filesToZip = new Dictionary <string, byte[]>
            {
                { "br.png", File.ReadAllBytes($@"{ Environment.CurrentDirectory }\Images\br.png") },
                { "minas_gerais.png", File.ReadAllBytes($@"{ Environment.CurrentDirectory }\Images\minas_gerais.png") }
            };

            byte[] zippedFileByteArray = ZipFileFromByteArrayList.Create(filesToZip);

            // Act
            byte[] newZippedFileByteArray = ZipFileFromAnotherZipFile.Create(zippedFileByteArray);

            // Assert
            Assert.True(newZippedFileByteArray.Length > 0);
        }
Beispiel #2
0
 public void ShouldThrowExceptionForInvalidParameter(byte[] file)
 {
     Assert.Throws <ArgumentException>(() => ZipFileFromAnotherZipFile.Create(file));
 }