package Ġorg . smart register . un ice ft un is ia . reporting . register Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . ImageView Ċ import Ġandroid . widget . ListView Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Assert . assertNotNull Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . Ro bo lectric Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ import Ġorg . ro bo lectric . annotation . Config Ċ import Ġorg . smart register . un ice ft un is ia . R Ċ import Ġorg . smart register . un ice ft un is ia . Test Un ice f T un is ia Application Ċ import Ġorg . smart register . un ice ft un is ia . activity . Child Register Activity Ċ import Ġorg . smart register . un ice ft un is ia . application . Un ice f T un is ia Application Ċ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ @ Config ( application Ġ= ĠTest Un ice f T un is ia Application :: class ) Ċ class ĠReport Register Activity Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcontroller Ġ= ĠRo bo lectric . build Activity ( Report Register Activity :: class . java ) ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġreport Register Activity : ĠReport Register Activity ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġ` Before Ġevery Ġtest `() Ġ{ ĊĠĠĠĠĠĠĠ Ġreport Register Activity Ġ= Ġcontroller . create (). resume (). get () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġlaunch Ġactivity Ġand Ġpopulate Ġlist Ġview `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġreport Register ListView Ġ= Ġreport Register Activity . findViewById < ListView >( R . id . report Register ListView ) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( report Register Activity . navigation Menu ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġreport Register ListView . adapter . count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġuse Ġthe Ġcorrect Ġlayout `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals ( report Register Activity . content View , ĠR . layout . activity _ report _ register ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġreturn Ġcorrect Ġdrawer Ġid `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals ( report Register Activity . drawer Layout Id , Ġreport Register Activity . navigation Menu . drawer . id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġreturn ĠChild Register Activity Ġclass `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals ( report Register Activity . on Back Activity (). name , ĠChild Register Activity :: class . java . name ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Should Ġperform Ġsync Ġand Ġupdate Ġstatus `() Ġ{ ĊĠĠĠĠĠĠĠ Ġreport Register Activity . on Sync Start () ĊĠĠĠĠĠĠĠ Ġval Ġreport Sync ImageView Ġ= Ġreport Register Activity . findViewById < ImageView >( R . id . report Sync Btn ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( report Sync ImageView . visibility , ĠView . GONE ) ĊĠĠĠĠĠĠĠ Ġval Ġsync Complete Preference Ġ= ĠUn ice f T un is ia Application . getInstance (). context (). all SharedPreferences (). get Preference (" sync Complete ") ĊĠĠĠĠĠĠĠ ĠassertEquals (" false ", Ġsync Complete Preference ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ After ĊĠĠĠ Ġfun Ġ` After Ġevery Ġtest `() Ġ{ ĊĠĠĠĠĠĠĠ Ġcontroller . pause (). stop (). destroy () ĊĠĠĠ Ġ} Ċ }