mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 22:46:22 +02:00
Create Nip19Test testing toInt32()
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
package com.vitorpamplona.amethyst.service
|
||||||
|
|
||||||
|
import org.junit.Assert
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
class Nip19Test {
|
||||||
|
|
||||||
|
@Test(expected = IllegalArgumentException::class)
|
||||||
|
fun to_int_32_length_smaller_than_4() {
|
||||||
|
toInt32(ByteArray(3))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expected = IllegalArgumentException::class)
|
||||||
|
fun to_int_32_length_bigger_than_4() {
|
||||||
|
toInt32(ByteArray(5))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test()
|
||||||
|
fun to_int_32_length_4() {
|
||||||
|
val actual = toInt32(ByteArray(4))
|
||||||
|
Assert.assertEquals(0, actual)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user