Skip to content

Instantly share code, notes, and snippets.

@eoinahern
Created May 13, 2019 08:55
Show Gist options
  • Select an option

  • Save eoinahern/a1db7c1b1e61dc7eebb30e8fcc647d43 to your computer and use it in GitHub Desktop.

Select an option

Save eoinahern/a1db7c1b1e61dc7eebb30e8fcc647d43 to your computer and use it in GitHub Desktop.

Revisions

  1. eoin_a created this gist May 13, 2019.
    29 changes: 29 additions & 0 deletions myTest.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@



    @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()
    }


    }