Skip to content

Commit c9945b1

Browse files
committed
Clean up
1 parent 08c1124 commit c9945b1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compressor/src/test/java/id/zelory/compressor/CompressorTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CompressorTest {
4646
}
4747

4848
@Test
49-
fun `compress with default specs`() = testDispatcher.runBlockingTest {
49+
fun `compress with default specs should execute default constraint`() = testDispatcher.runBlockingTest {
5050
// Given
5151
mockkConstructor(DefaultConstraint::class)
5252
var executedConstraint = 0
@@ -69,7 +69,7 @@ class CompressorTest {
6969
}
7070

7171
@Test
72-
fun `compress with custom specs`() = testDispatcher.runBlockingTest {
72+
fun `compress with custom specs should execute all constraint provided`() = testDispatcher.runBlockingTest {
7373
// Given
7474
mockkConstructor(ResolutionConstraint::class)
7575
mockkConstructor(QualityConstraint::class)

compressor/src/test/java/id/zelory/compressor/UtilTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ class UtilTest {
3030
}
3131

3232
@Test
33-
fun `verify get compress format from file`() {
33+
fun `get compress format from file should return correct format`() {
3434
assertThat(File("a_file.png").compressFormat(), equalTo(Bitmap.CompressFormat.PNG))
3535
assertThat(File("a_file.webp").compressFormat(), equalTo(Bitmap.CompressFormat.WEBP))
3636
assertThat(File("a_file.jpg").compressFormat(), equalTo(Bitmap.CompressFormat.JPEG))
3737
assertThat(File("a_file.jpeg").compressFormat(), equalTo(Bitmap.CompressFormat.JPEG))
3838
}
3939

4040
@Test
41-
fun `verify get extension from compress format`() {
41+
fun `get extension from compress format should return correct extension`() {
4242
assertThat(Bitmap.CompressFormat.PNG.extension(), equalTo("png"))
4343
assertThat(Bitmap.CompressFormat.WEBP.extension(), equalTo("webp"))
4444
assertThat(Bitmap.CompressFormat.JPEG.extension(), equalTo("jpg"))
@@ -152,7 +152,7 @@ class UtilTest {
152152
}
153153

154154
@Test
155-
fun `verify copy to cache`() {
155+
fun `copy to cache should copy file to right folder`() {
156156
// Given
157157
val context = mockk<Context>(relaxed = true)
158158
every { context.cacheDir.path } returns "folder/"
@@ -191,7 +191,7 @@ class UtilTest {
191191
}
192192

193193
@Test
194-
fun `overwrite with different format should delete old file and save image with new format`() {
194+
fun `overwrite with different format should save image with new format extension`() {
195195
// Given
196196
mockkStatic("id.zelory.compressor.UtilKt")
197197
every { saveBitmap(any(), any(), any(), any()) } just Runs

0 commit comments

Comments
 (0)