Created
January 23, 2022 11:40
-
-
Save phellipealexandre/1eb8a5fec13d7fd99e5f229e178a408c 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 notes count from server when requested`() { | |
val notesApiStub = mockk<NotesApi>() //Stub Double | |
val noteRepository = NoteRepository(notesApiStub) | |
val note = generateDummyNote() //Dummy Double | |
every { notesApiStub.fetchAllNotes() } returns listOf(note, note) | |
val allNotesCount = noteRepository.getNoteCount() | |
assertEquals(expected = 2, actual = allNotesCount) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment