Updated on 2026-08-14

This commit is contained in:
Tangem 2025-06-23 16:37:57 +04:00
parent b9bb9e1086
commit 058a6ab4d5
15 changed files with 969 additions and 256 deletions

View file

@ -33,4 +33,5 @@ dependencies {
implementation(tangemDeps.card.core)
implementation(deps.test.junit5)
implementation(deps.test.truth)
}

View file

@ -0,0 +1,14 @@
package com.tangem.common.test.utils
import arrow.core.Either
import com.google.common.truth.Truth
fun <B> assertEither(actual: Either<Throwable, B>, expected: Either<Throwable, B>) {
actual
.onRight { Truth.assertThat(it).isEqualTo(expected) }
.onLeft {
val expectedError = expected.leftOrNull() ?: error("Expected must be Either.Left")
Truth.assertThat(it::class.java).isEqualTo(expectedError::class.java)
}
}