From here we now know that robolectric does not have a shadow object but we can create a custom shadow object for a snackbar.It's ashame they have one for toast but not for snackbar.
I am showing a snackbar in my code when there is no network connection. I'd like to know how can i write a unit test (with robolectric as the test runner) that can verify that a snackbar gets shown when there is no network connection.
Its a little hard because the snackbar is not in xml. So when i declare my actually Activity controller it doesn't have a snackbar at that time.
You know how to test a toast we have ShadowToast.getTextOfLatestToast()
i want one for snackBar
im currently using org.robolectric:robolectric:3.0-rc2 and dont see ShadowSnackbar.class available.