Ben Abramovitch
01/02/2020, 5:07 PMnwh
01/02/2020, 5:45 PMdeclareMock
to the top of the test method, to ensure that the mocked instance is prepared before any other method requests the type.Ben Abramovitch
01/02/2020, 5:53 PMlateinit var someMock: DirectorySavedFilterBinder
And initialized the mock immediately after initializing Koin in @Before
startKoin {
modules(rowBindingsModule)
}
someMock = declareMock<DirectorySavedFilterBinder>()
Then the verify at the bottom of my test still failed
verify(someMock).bind(any())
nwh
01/02/2020, 5:55 PMwhenever(rowsToDisplay[1]).thenReturn(row)
Be included within the declareMock
call? As in whenever(rowsToDisplay.get(eq(1)).thenReturn(row)
Ben Abramovitch
01/02/2020, 5:55 PMnwh
01/02/2020, 6:02 PMverify
method so I'm a bit out of my league here. I'll keep looking to see if I notice anythingBen Abramovitch
01/02/2020, 6:07 PMBen Abramovitch
01/02/2020, 6:08 PMBen Abramovitch
01/02/2020, 6:13 PM@Test
fun `binder binds`() {
someMock.bind(mock())
verify(someMock).bind(any())
}
Ben Abramovitch
01/02/2020, 6:17 PM