-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
library/src/test/java/com/antonpotapov/ExampleUnitTest.java
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
library/src/test/java/com/antonpotapov/PoliwhirlApiTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.antonpotapov | ||
|
||
import android.graphics.Bitmap | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.RobolectricTestRunner | ||
|
||
/** | ||
* ====================================== | ||
* Created by awesome potapov on 30.10.17. | ||
* ====================================== | ||
*/ | ||
@RunWith(RobolectricTestRunner::class) | ||
class PoliwhirlApiTests { | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiAccuracy1() { | ||
Poliwhirl().setAccuracy(0).generate(Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888)) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiAccuracy2() { | ||
Poliwhirl().setAccuracy(11).generate(Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888)) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiDistance() { | ||
Poliwhirl().setMinAvailableColorDistance(-1) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiHorizontalBorder1() { | ||
Poliwhirl().setHorizontalBorderSizeDivideMultiplier(0) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiHorizontalBorder2() { | ||
Poliwhirl().setHorizontalBorderSizeDivideMultiplier(1) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiVerticalBorder1() { | ||
Poliwhirl().setVerticalBorderSizeDivideMultiplier(0) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiVerticalBorder2() { | ||
Poliwhirl().setVerticalBorderSizeDivideMultiplier(1) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiBorder1() { | ||
Poliwhirl().setBorderSizeDivideMultiplier(0) | ||
} | ||
|
||
@Test(expected = IllegalArgumentException::class) | ||
fun testApiBorder2() { | ||
Poliwhirl().setBorderSizeDivideMultiplier(1) | ||
} | ||
} |