Updated on 2026-08-14

This commit is contained in:
Tangem 2022-09-10 13:25:47 +03:00
parent f45da41502
commit b6e2da91c0
2 changed files with 29 additions and 16 deletions

View file

@ -0,0 +1,29 @@
package com.tangem.domain.features
import com.google.common.truth.Truth
import com.tangem.blockchain.common.Blockchain
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.domain.common.extensions.toNetworkId
import org.junit.Test
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class BlockchainNetworkIdTests {
@Test
fun checkAppropriateImplementationForNetworkIds() {
val unimplementedIds = Blockchain.values()
.toMutableList()
.apply { remove(Blockchain.Unknown) }.map {
val networkId = it.toNetworkId()
networkId to Blockchain.fromNetworkId(networkId)
}.filter { it.second == null }
if (unimplementedIds.isEmpty()) return
val message = unimplementedIds.joinToString("\n") { it.first }
Truth.assert_().withMessage(message).fail()
}
}

View file

@ -1,16 +0,0 @@
package com.tangem.domain.features
import org.junit.Assert.assertEquals
import org.junit.Test
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}