public void NullCheck() { IReadOnlyCollection <ZipArchiveEntry> input = null; // Act + Assert Assert.Throws <ArgumentNullException>(() => ZipArchiveService.ReadFilesFromZipStream(input, ".exe")); }
public void NullCheck() { // Arrange IReadOnlyCollection <ZipArchiveEntry> input = new ReadOnlyCollection <ZipArchiveEntry>(new List <ZipArchiveEntry>()); var service = new ZipArchiveService(); // Act + Assert Assert.Throws <ArgumentNullException>(() => service.Extract(null, "Dir1", new List <string> { ".pdb" })); Assert.Throws <ArgumentNullException>(() => ZipArchiveService.ReadFilesFromZipStream(input, null)); }
public void TheCorrectExtensionsAreFiltered() { // Arrange IReadOnlyCollection <ZipArchiveEntry> input = CreateTestZipEntries(new string[] { "foo.pdb", "bar.txt", "foobar.dll", @"a\bar.pdb" }); string[] expected = new string[] { "foo.pdb", @"a\bar.pdb" }; // Act var result = ZipArchiveService.ReadFilesFromZipStream(input, ".pdb"); // Assert Assert.Equal(expected.Length, result.Count()); foreach (string s in expected) { Assert.Contains(s, result); } }