added JNI test

I am a little excited about this because it will be a great way to test
Rust functionality quickly and iterate quickly because we will not have
to update and run the full app.
This commit is contained in:
Kevin Gorham 2018-11-28 02:36:26 -05:00 committed by Jack Grigg
parent 241c646f14
commit 72b594b0d0
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package cash.z.wallet.sdk.jni
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Test
class JniConverterTest {
val converter:JniConverter = JniConverter()
@Test
fun testGetAddress_exists() {
assertNotNull(converter.getAddress("dummyseed".toByteArray()))
}
@Test
fun testGetAddress_valid() {
val address = converter.getAddress("dummyseed".toByteArray())
val expectedAddress = "ztestsapling1snmqdnfqnc407pvqw7sld8w5zxx6nd0523kvlj4jf39uvxvh7vn0hs3q38n07806dwwecqwke3t"
assertEquals("Invalid address", expectedAddress, address)
}
}