Skip to content

Commit d9bd96b

Browse files
committed
test: add test for zipping multiple files
1 parent b458643 commit d9bd96b

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

tests/Test.Yaapii.Zip/IsZipArchiveTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ public void DetectsOwnZip()
1010
{
1111
Assert.True(
1212
new IsZipArchive(
13-
new Zipped("some/path/file.txt", new InputOf("Some Data"))
13+
new Zipped(
14+
"some/path/file.txt",
15+
new InputOf("Some Data")
16+
)
1417
).Value()
1518
);
1619
}

tests/Test.Yaapii.Zip/ZipPathsTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ public void IsThreadSafe()
5151
[Fact]
5252
public void ListsAllPaths()
5353
{
54-
var paths =
55-
new ZipPaths(
56-
new ResourceOf("Datum/example.zip", this.GetType())
57-
);
5854
Assert.Equal(
5955
6,
60-
new Atoms.Enumerable.LengthOf(paths).Value()
56+
new Atoms.Enumerable.LengthOf(
57+
new ZipPaths(
58+
new ResourceOf("Datum/example.zip", this.GetType())
59+
)
60+
).Value()
6161
);
6262
}
6363

tests/Test.Yaapii.Zip/ZippedTests.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using Xunit;
1+
using System.Collections.Generic;
2+
using Xunit;
3+
using Yaapii.Atoms;
24
using Yaapii.Atoms.IO;
35
using Yaapii.Atoms.Text;
46

@@ -24,5 +26,24 @@ public void HasContent()
2426
).AsString()
2527
);
2628
}
29+
30+
[Fact]
31+
public void HasFiles()
32+
{
33+
Assert.Equal(
34+
2,
35+
new Atoms.Enumerable.LengthOf(
36+
new ZipPaths(
37+
new Zipped(
38+
new Dictionary<string, IInput>()
39+
{
40+
{"small.dat", new InputOf("I feel so compressed") },
41+
{"smaller.dat", new InputOf("I'm so compressed") }
42+
}
43+
)
44+
)
45+
).Value()
46+
);
47+
}
2748
}
2849
}

0 commit comments

Comments
 (0)