Skip to content

Instantly share code, notes, and snippets.

@phellipealexandre
Last active July 11, 2021 14:30
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/e68827ebacd64c828255f7f3c744a112 to your computer and use it in GitHub Desktop.
Save phellipealexandre/e68827ebacd64c828255f7f3c744a112 to your computer and use it in GitHub Desktop.
@Test
fun `Track analytics event when creating new note`() {
val analyticsWrapperMock = //Mock
val noteAnalytics = NoteAnalytics(analyticsWrapperMock) //System under test
noteAnalytics.trackNewNoteEvent(NoteType.Supermarket)
//Verifies that specific call has happened
verify(exactly = 1) { analyticsWrapperMock.logEvent("NewNote", "SuperMarket") }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment