Skip to content

Instantly share code, notes, and snippets.

@maskaravivek
Created May 17, 2018 18:56
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 maskaravivek/930b97d3f5e398d6df33bc50f604285c to your computer and use it in GitHub Desktop.
Save maskaravivek/930b97d3f5e398d6df33bc50f604285c to your computer and use it in GitHub Desktop.
@Test
fun displayUserName() {
doReturn("Hello %s!").`when`(context)!!.getString(any(Int::class.java))
val displayUserName = userService!!.displayUserName("Test")
assertEquals(displayUserName, "Hello Test!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment