Created
October 24, 2017 14:20
-
-
Save fbcbl/b4581791df82562d638d5ec883a26dcb to your computer and use it in GitHub Desktop.
kotlin_testing_pt3_example5
This file contains hidden or 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
@Test | |
fun `an underage user can't drink`() { | |
val ricardo = User( | |
firstName = "Ricardo", | |
lastName = "Trindade", | |
age = 17) | |
val ricardoDrinks = { ricardo.drink() } | |
ricardoDrinks `should throw` UnderageDrinkingException::class | |
`with message` "You can't drink." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment