Updated on 2026-08-14
This commit is contained in:
parent
07732b4b55
commit
a67df03d63
1 changed files with 4 additions and 10 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue