Last active
July 11, 2021 16:47
-
-
Save phellipealexandre/c4e73ffdd418fd2271be1be89daf0b21 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 `Track analytics event when creating new note`() { | |
val analyticsWrapperSpy = //Spy | |
val noteAnalytics = NoteAnalytics(analyticsWrapperSpy) //System under test | |
//AnalyticsWrapperSpy records the interaction with NoteAnalytics under the hoods | |
noteAnalytics.trackCreateNewNoteEvent(NoteType.Supermarket) | |
//Based on the its internal implementation, the spy returns the state of the dependency | |
val numberOfEvents = analyticsWrapperSpy.getNewNoteEventsRegistered() | |
assertEquals(expected = 1, actual = numberOfEvents) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment