Search in sources :

Example 1 with TestFavoriteActivity

use of io.github.hidroh.materialistic.test.TestFavoriteActivity in project materialistic by hidroh.

the class FavoriteActivityTest method testSaveState.

@Test
public void testSaveState() {
    Bundle outState = new Bundle();
    controller.saveInstanceState(outState);
    ActivityController<TestFavoriteActivity> controller = Robolectric.buildActivity(TestFavoriteActivity.class).create(outState).postCreate(outState).start().resume().visible();
    assertEquals(2, ((RecyclerView) controller.get().findViewById(R.id.recycler_view)).getAdapter().getItemCount());
    controller.pause().stop().destroy();
    reset(keyDelegate);
}
Also used : Bundle(android.os.Bundle) TestFavoriteActivity(io.github.hidroh.materialistic.test.TestFavoriteActivity) RecyclerView(android.support.v7.widget.RecyclerView) ShadowRecyclerView(io.github.hidroh.materialistic.test.shadow.ShadowRecyclerView) SlowTest(io.github.hidroh.materialistic.test.suite.SlowTest) Test(org.junit.Test)

Aggregations

Bundle (android.os.Bundle)1 RecyclerView (android.support.v7.widget.RecyclerView)1 TestFavoriteActivity (io.github.hidroh.materialistic.test.TestFavoriteActivity)1 ShadowRecyclerView (io.github.hidroh.materialistic.test.shadow.ShadowRecyclerView)1 SlowTest (io.github.hidroh.materialistic.test.suite.SlowTest)1 Test (org.junit.Test)1