package Ġapps . ric as ares . com . domain . presenter Ċ Ċ import Ġapps . ric as ares . com . domain . factory . Listing Factory Ċ import Ġapps . ric as ares . com . domain . model . Listing Ċ import Ġapps . ric as ares . com . domain . model . Post Hint Ċ import Ġapps . ric as ares . com . domain . view . Listing Item View Ċ import Ġorg . hamcrest . Core Matchers .` is ` Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mockito .* Ċ Ċ class ĠListing Item Presenter Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġview : ĠListing Item View Ġ= Ġmock ( Listing Item View :: class . java ) ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġpresenter : ĠListing Item Presenter ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter Ġ= ĠListing Item Presenter () ĊĠĠĠĠĠĠĠ Ġpresenter . attach View ( view ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest SetData () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlisting Ġ= ĠListing Factory . make Listing ( 5 ) ĊĠĠĠĠĠĠĠ Ġpresenter . set Listing ( listing ) ĊĠĠĠĠĠĠĠ ĠassertThat ( presenter . getItem Count (), Ġ` is `( 5 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest BindView Image () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlisting Ġ= ĠListing Factory . make Listing Of ( 5 , ĠPost Hint . IMAGE ) ĊĠĠĠĠĠĠĠ Ġpresenter . set Listing ( listing ) ĊĠĠĠĠĠĠĠ Ġpresenter . on BindView ( view , Ġ 0 ) ĊĠĠĠĠĠĠĠ Ġverify ( view )?. setTitle ( listing . entries [ 0 ]. title ) ĊĠĠĠĠĠĠĠ Ġverify ( view )?. set Sub Red dit ( listing . entries [ 0 ]. sub Red dit ) ĊĠĠĠĠĠĠĠ Ġ// verify ( view )?. set Preview Image ( listing . entries [ 0 ]. thumb , Ġ) ĊĠĠĠĠĠĠĠ Ġverify ( view )?. set Points ( listing . entries [ 0 ]. points . toString ()) ĊĠĠĠĠĠĠĠ Ġverify ( view )?. set Comments ( listing . entries [ 0 ]. comment Count . toString ()) ĊĠĠĠĠĠĠĠ Ġ// verify ( view )?. setDate (" now ") ĊĠĠĠ Ġ} Ċ }