Skip to content

Instantly share code, notes, and snippets.

@fbcbl
Last active September 29, 2017 22:17
Show Gist options
  • Save fbcbl/d7cf6a37e521e11d3b3a4464f35326d8 to your computer and use it in GitHub Desktop.
Save fbcbl/d7cf6a37e521e11d3b3a4464f35326d8 to your computer and use it in GitHub Desktop.
Kotlin Testing Pt.1 Classes
// Class that is going to be the focus of our test
class Greeter(
private val user: User) {
fun getEnglishGreeting() = "Hello, ${user.fullName()}!"
}
// Class used as a dependency
class User(
private val firstName: String,
private val lastName: String) {
fun fullName(): String = "$firstName $lastName"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment