Updated on 2026-08-14
This commit is contained in:
parent
b9bb9e1086
commit
058a6ab4d5
15 changed files with 969 additions and 256 deletions
|
|
@ -33,4 +33,5 @@ dependencies {
|
|||
implementation(tangemDeps.card.core)
|
||||
|
||||
implementation(deps.test.junit5)
|
||||
implementation(deps.test.truth)
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue