Last active
May 18, 2022 18:25
-
-
Save phellipealexandre/990f90db9c709409ffd2ddaddb73386a 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 `Retrieve notes count from server when requested`() { | |
val notesApiStub = //Stub | |
val note = //Dummy | |
val noteRepository = NoteRepository(notesApiStub) //System under test | |
//Stub configuration. Hard-coded value returned will be a list with 2 entries. | |
//This method is going to be called by noteRepository.getNoteCount() | |
every { notesApiStub.fetchAllNotes() } returns listOf(note, note) | |
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