Created
November 7, 2020 20:59
-
-
Save skywall/ff4c6e49a79e7581a6cb5ee1388dab29 to your computer and use it in GitHub Desktop.
TicketMachineTest - Naive
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 TicketMachineTest { | |
private val printerMock = mockk<Printer>(relaxed = true) | |
@Test | |
fun `given ticket machine when adult ticket selected and paid then ticket printed`() { | |
val ticketMachine = TicketMachine(printerMock, Display(), CoinCounter()) | |
ticketMachine.selectTicket(TicketType.ADULT) | |
ticketMachine.insertCoin() | |
ticketMachine.insertCoin() | |
verify { printerMock.printTicket(TicketType.ADULT) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment