-
-
Save le0nidas/cfcd5fd13108292f4146434becec9991 to your computer and use it in GitHub Desktop.
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
@Test fun `every visited URL gets saved to the browser's history`() { | |
val mockHistory = MockHistory() | |
val browser = Browser(mockHistory) | |
browser.visit(URL("https://www.le0nidas.gr")) | |
mockHistory.verifySavedUrlIs(expectedURL = URL("https://www.le0nidas.gr")) | |
} | |
private class MockHistory : History { | |
private var savedURL: URL? = null | |
override fun push(url: URL) { | |
savedURL = url | |
} | |
override fun pop(): URL { | |
TODO("Not yet implemented") | |
} | |
override fun peek(): URL { | |
TODO("Not yet implemented") | |
} | |
fun verifySavedUrlIs(expectedURL: URL) { | |
assertThat(savedURL, equalTo(expectedURL)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment