1+ package eu .davidea .flexibleadapter ;
2+
3+ import org .junit .Before ;
4+ import org .junit .Test ;
5+ import org .junit .runner .RunWith ;
6+ import org .robolectric .RobolectricGradleTestRunner ;
7+ import org .robolectric .annotation .Config ;
8+
9+ import java .util .List ;
10+
11+ import eu .davidea .flexibleadapter .items .AbstractFlexibleItem ;
12+ import eu .davidea .samples .flexibleadapter .services .DatabaseService ;
13+
14+ import static org .junit .Assert .assertTrue ;
15+
16+ /**
17+ * @author Davide Steduto
18+ * @since 23/06/2016
19+ */
20+ @ RunWith (RobolectricGradleTestRunner .class )
21+ @ Config (constants = BuildConfig .class )
22+ public class HeadersSectionsTest {
23+
24+ FlexibleAdapter <AbstractFlexibleItem > mAdapter ;
25+ List <AbstractFlexibleItem > mItems ;
26+
27+ @ Before
28+ public void setUp () throws Exception {
29+ DatabaseService .getInstance ().createHeadersSectionsDatabase ();
30+ mItems = DatabaseService .getInstance ().getDatabaseList ();
31+ mAdapter = new FlexibleAdapter <>(mItems );
32+ }
33+
34+ @ Test
35+ public void testItemCount () throws Exception {
36+ assertTrue (mAdapter .getItemCount () == mItems .size ());
37+ }
38+
39+ @ Test
40+ public void testSetDisplayHeadersAtStartUp () throws Exception {
41+ assertTrue (mAdapter .getHeaderItems ().size () == 0 );
42+ mAdapter .setDisplayHeadersAtStartUp (true );
43+ System .out .println ("Headers = " + mAdapter .getHeaderItems ().size ());
44+ mAdapter .setDisplayHeadersAtStartUp (true );
45+ System .out .println ("Headers = " + mAdapter .getHeaderItems ().size ());
46+ assertTrue (mAdapter .getHeaderItems ().size () > 0 );
47+ }
48+
49+ @ Test
50+ public void testIsHeader () throws Exception {
51+ }
52+
53+ @ Test
54+ public void testHasHeader () throws Exception {
55+
56+ }
57+
58+ @ Test
59+ public void testHasSameHeader () throws Exception {
60+
61+ }
62+
63+ @ Test
64+ public void testGetHeaderOf () throws Exception {
65+
66+ }
67+
68+ @ Test
69+ public void testShowAllHeaders () throws Exception {
70+
71+ }
72+
73+ @ Test
74+ public void testHideAllHeaders () throws Exception {
75+
76+ }
77+
78+ }
0 commit comments