Skip to content

Instantly share code, notes, and snippets.

@phellipealexandre
Created January 23, 2022 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phellipealexandre/1eb8a5fec13d7fd99e5f229e178a408c to your computer and use it in GitHub Desktop.
Save phellipealexandre/1eb8a5fec13d7fd99e5f229e178a408c to your computer and use it in GitHub Desktop.
@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