package Ġes . np atar ino . android . got challenge . data . use case Ċ Ċ import Ġes . np atar ino . android . got challenge . data . model . House Ċ import Ġes . np atar ino . android . got challenge . data . repository . House s Repository Ċ import Ġio . reactivex . Single Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Inject Mocks Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito .` when ` Ċ import Ġorg . mockito . Mockito . mock Ċ import Ġorg . mockito . Mockito . verify Ċ import Ġorg . mockito . Mockito Annotations Ċ Ċ class ĠHouse s UseCase Test Ġ{ ĊĊĠĠĠ Ġ@ Inject Mocks ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġhouse s UseCase : ĠHouse s UseCase ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġhouse s Repository : ĠHouse s Repository ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ= ĠMockito Annotations . init Mocks ( this ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget House s () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhouse Ġ= Ġmock ( House :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġhouse List Ġ= Ġarray ListOf < House >() ĊĠĠĠĠĠĠĠ Ġhouse List . add ( house ) ĊĊĠĠĠĠĠĠĠ Ġ` when `( house s Repository . get House s ()). thenReturn ( Single . just ( house List )) ĊĊĠĠĠĠĠĠĠ Ġhouse s UseCase . get House s () ĊĊĠĠĠĠĠĠĠ Ġverify ( house s Repository ). get House s () ĊĠĠĠ Ġ} Ċ }