Updated on 2026-08-14

This commit is contained in:
Tangem 2022-09-10 13:31:45 +03:00
parent 07732b4b55
commit a67df03d63

View file

@ -6,24 +6,18 @@ 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 }
.apply { remove(Blockchain.Unknown) }
.map { it to Blockchain.fromNetworkId(it.toNetworkId()) }
.filter { it.second == null }
if (unimplementedIds.isEmpty()) return
val message = unimplementedIds.joinToString("\n") { it.first }
val message = unimplementedIds.joinToString("\n") { it.first.fullName }
Truth.assert_().withMessage(message).fail()
}
}