@ file : Suppress (" Illegal Identifier ") Ċ package Ġcom . photo viewer . domain . use cases Ċ Ċ import Ġcom . n ha ar man . mockito _ kotlin . mock Ċ import Ġcom . n ha ar man . mockito _ kotlin . wh enever Ċ import Ġcom . photo viewer . data . entity . Photo Entity Ċ import Ġcom . photo viewer . data . repository . Photo Entity DataSource Ċ import Ġcom . photo viewer . domain . Photo Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġrx . Observable . just Ċ import Ġrx . Scheduler Ċ import Ġrx . ob servers . Test Subscriber Ċ import Ġjava . util .* Ċ import Ġkotlin . test . assertEquals Ċ Ċ class ĠSearch By Title Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġm Mock Photo Entity DataSource : ĠPhoto Entity DataSource Ġ= Ġmock () ĊĠĠĠ Ġprivate Ġval Ġm Mock Scheduler : ĠScheduler Ġ= Ġmock () ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm Search By Title : ĠSearch By Title ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm Test Subscriber : ĠTest Subscriber < List < Photo >> ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval ĠFA KE _ PH OTO _ TITLE Ġ= Ġ" Fake ĠTitle " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Before Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġm Test Subscriber Ġ= ĠTest Subscriber . create () ĊĠĠĠĠĠĠĠ Ġm Search By Title Ġ= ĠSearch By Title ( m Mock Scheduler , Ġm Mock Scheduler , Ġm Mock Photo Entity DataSource ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġ` should Ġsearch Ġby Ġtitle `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġphotos Ġ= Ġcreate Photos List () ĊĊĠĠĠĠĠĠĠ Ġassume DataSource Has Se ar ched Content ( photos ) ĊĊĠĠĠĠĠĠĠ Ġm Search By Title . set Se ar ched Title ( FA KE _ PH OTO _ TITLE ) ĊĠĠĠĠĠĠĠ Ġm Search By Title . call (). subscribe ( m Test Subscriber ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( photos . size , Ġm Test Subscriber . onNext Events [ 0 ]. size ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġassume DataSource Has Se ar ched Content ( photos : ĠArrayList < Photo Entity >) Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( m Mock Photo Entity DataSource . search Photos By Title ( FA KE _ PH OTO _ TITLE )). thenReturn ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġjust < List < Photo Entity >>( photos )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Photos List () Ġ= ĠArrayList < Photo Entity >(). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġadd ( Photo Entity (). apply Ġ{ Ġtitle Ġ= ĠFA KE _ PH OTO _ TITLE Ġ}) ĊĠĠĠ Ġ} Ċ }