package Ġcom . base project . inter view Ċ Ċ import Ġcom . dou glas al ip io . lu as forecast s . forecast . Forecast Contract Ċ import Ġcom . dou glas al ip io . lu as forecast s . forecast . Forecast Interactor Ċ import Ġcom . dou glas al ip io . lu as forecast s . forecast . Forecast Presenter Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . capture Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito .* Ċ import Ġorg . mockito . Mockito .* ĊĊ Ċ class ĠFore cast Presenter Test Ġ{ ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġview : ĠFore cast Contract . View ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġinter actor : ĠFore cast Contract . Interactor ĊĠĠĠ Ġ@ Captor ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġget Forecast Callback Captor : ĠArgument Captor < Forecast Interactor . Get Forecast Callback > ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġpresenter : ĠFore cast Presenter ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠĠĠĠĠĠĠ Ġpresenter Ġ= ĠFore cast Presenter ( inter actor ) ĊĠĠĠĠĠĠĠ Ġpresenter . take View ( view ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġreturn Ġa Ġlist Ġof Ġfeatures `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġforecast s Response Ġ= Ġforecast () ĊĠĠĠĠĠĠĠ Ġpresenter . fetch Forecast s () ĊĠĠĠĠĠĠĠ Ġverify ( inter actor ). request Forecast s ( capture ( get Forecast Callback Captor )) ĊĠĠĠĠĠĠĠ Ġget Forecast Callback Captor . value . on Forecast Loaded ( forecast s Response ) ĊĠĠĠĠĠĠĠ Ġverify ( view ). show Forecast s ( forecast s Response ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġshow Ġa Ġerror Ġmessage `() Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter . fetch Forecast s () ĊĠĠĠĠĠĠĠ Ġverify ( inter actor ). request Forecast s ( capture ( get Forecast Callback Captor )) ĊĠĠĠĠĠĠĠ Ġget Forecast Callback Captor . value . on Data Not Available (" data Ġnot Ġavailable .") ĊĠĠĠĠĠĠĠ Ġverify ( view ). show Data Error () ĊĠĠĠ Ġ} Ċ }