Search in sources :

Example 1 with FewChipsFacade

use of com.beloo.chipslayoutmanager.sample.ui.FewChipsFacade in project ChipsLayoutManager by BelooS.

the class FewChipsRowTest method setUp.

@Before
public void setUp() throws Throwable {
    MockitoAnnotations.initMocks(this);
    activity = activityTestRule.getActivity();
    RecyclerView rvTest = (RecyclerView) activityTestRule.getActivity().findViewById(R.id.rvTest);
    //disable all animations
    rvTest.setItemAnimator(null);
    layoutManager = getLayoutManager();
    doReturn(layoutManager).when(layoutManagerFactory).layoutManager(any());
    IItemsFacade<ChipsEntity> chipsFacade = spy(new FewChipsFacade());
    items = chipsFacade.getItems();
    when(chipsFacade.getItems()).thenReturn(items);
    TestActivity.setItemsFactory(chipsFacade);
    TestActivity.setLmFactory(layoutManagerFactory);
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) FewChipsFacade(com.beloo.chipslayoutmanager.sample.ui.FewChipsFacade) ChipsEntity(com.beloo.chipslayoutmanager.sample.entity.ChipsEntity) Before(org.junit.Before)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1 ChipsEntity (com.beloo.chipslayoutmanager.sample.entity.ChipsEntity)1 FewChipsFacade (com.beloo.chipslayoutmanager.sample.ui.FewChipsFacade)1 Before (org.junit.Before)1