Last active
May 18, 2022 18:25
-
-
Save phellipealexandre/a458d52d2c58e15aa0c40338cffa1488 to your computer and use it in GitHub Desktop.
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 `Retrieve all notes when requested`() { | |
val noteApiFake = FakeNoteApi() //Fake double implementing the same interface as the original | |
val noteRepository = NoteRepository(noteApiFake) //System under test | |
val note = //Dummy | |
noteApiFake.uploadNote(note) //Configuring the fake | |
noteApiFake.uploadNote(note) //Configuring the fake | |
//Fake with real and lightweight implementation is going to be used under the hoods | |
val allNotes = noteRepository.getNotes() | |
assertEquals(expected = 2, actual = allNotes.size) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment