Last active
September 29, 2017 22:17
-
-
Save fbcbl/d7cf6a37e521e11d3b3a4464f35326d8 to your computer and use it in GitHub Desktop.
Kotlin Testing Pt.1 Classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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