ServiceB { fun methodB() { … } } class Test { fun test() { val serviceA: ServiceA = mock() val serviceB: ServiceB = mock() serviceA.methodA() serviceB.methodB() val inOrder = inOrder(serviceA, serviceB) inOrder.verify(serviceA).methodA() inOrder.verify(serviceB).methodB() } }
ServiceB { fun methodB() { … } } class Test { fun test() { val serviceA: ServiceA = mock() val serviceB: ServiceB = mock() serviceA.methodA() serviceB.methodB() val inOrder = inOrder(serviceA, serviceB) inOrder.verify(serviceA).methodA() inOrder.verify(serviceB).methodB() } }
first and last name`() { val user = User(firstName = "Fábio", lastName = "Carballo", age = 26) assertEquals("Fábio Carballo", user.fullName) user.fullName `should equal` "Fábio Carballo” // Kluent }
verification") { it("returns true when the suggestion is correct") { game.suggestLetter('a') `should equal` true } it("returns false when the suggestion is incorrect") { game.suggestLetter('f') `should equal` false } } })
verification") { it("returns true when the suggestion is correct") { game.suggestLetter('a') `should equal` true } it("returns false when the suggestion is incorrect") { game.suggestLetter('f') `should equal` false } } })
new game with the hidden word being $hiddenWord:") { val game = Hangman(hiddenWord) on(“correct suggestion") { game.suggestLetter(‘a’) it("has no wrong answers") { game.wrongAnswerCount `should equal` 0 } it("shows the guessed letters") { game.dashedWord `should equal` "a----" } } } })
new game with the hidden word being $hiddenWord:") { val game = Hangman(hiddenWord) on(“correct suggestion") { game.suggestLetter(‘a’) it("has no wrong answers") { game.wrongAnswerCount `should equal` 0 } it("shows the guessed letters") { game.dashedWord `should equal` "a----" } } } })