Skip to content

cafesilencio/snackbarshadow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

snackbarshadow

A shadow class for snackbars for use in Robolectric tests

Usage:

@RunWith(RobolectricTestRunner::class)

@Config(shadows = [ShadowSnackbar::class])

class MyTest {

@Test
fun snackBarCmdTest() {
    val activity = Robolectric.buildActivity(MainActivity::class.java).create().start().resume().visible().get()

    activity.doSomethingToTriggerASnackbar()

    assertThat(ShadowSnackbar.getTextOfLatestSnackbar(), 'is'(activity.getString(R.string.ok))
}

}

About

A shadow class for snackbars for use in Robolectric tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages