Skip to content

Instantly share code, notes, and snippets.

@eoinahern
Created May 13, 2019 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eoinahern/a1db7c1b1e61dc7eebb30e8fcc647d43 to your computer and use it in GitHub Desktop.
Save eoinahern/a1db7c1b1e61dc7eebb30e8fcc647d43 to your computer and use it in GitHub Desktop.
@Test
fun testGetCurrency() {
val item: Pair<DomainCurrency, List<DomainCurrency>> = Pair(
DomainCurrency("USD", "1.00", 2, "US DOLLAR"),
listOf(DomainCurrency("EUR", "12.00", 1, "EURO"))
)
given {
runBlocking { mockUsecase.executeUsecase(any()) }
}.willReturn(Either.Right(item))
currencyViewModel.observeData().observeForever {
val domain = it.first
Assert.assertEquals(domain.amount, "zzzzz")
Assert.assertEquals(domain.currencySymbol, "cccc")
}
runBlocking {
currencyViewModel.getCurrencyList()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment