Skip to content

Instantly share code, notes, and snippets.

@sukyology
Created January 17, 2021 02:44
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 sukyology/4913a9f81c03c3b4806b60da512c6770 to your computer and use it in GitHub Desktop.
Save sukyology/4913a9f81c03c3b4806b60da512c6770 to your computer and use it in GitHub Desktop.
interface Foo {
fun bar(): Bar
}
interface Bar {
val value: String
}
class ExampleTest {
@Test
fun `method chain`() {
val foo: Foo = mockk()
`every` { foo.bar().value } returns "mock"
val bar = foo.bar()
assertEquals("mock", bar.value) // success
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment