/* Ċ Ġ* ĠCopyright Ġ 2 0 1 9 ĠAnd rey ĠT ol pe ev Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġcom . github . v ase 4 kin . team city app . navigation . presenter Ċ Ċ import Ġcom . github . v ase 4 kin . team city app . account . create . data . On Loading Listener Ċ import Ġcom . github . v ase 4 kin . team city app . navigation . api . Build Type Ċ import Ġcom . github . v ase 4 kin . team city app . navigation . api . Navigation Item Ċ import Ġcom . github . v ase 4 kin . team city app . navigation . data . Navigation DataManager Ċ import Ġcom . github . v ase 4 kin . team city app . navigation . extractor . Navigation Value Extractor Ċ import Ġcom . github . v ase 4 kin . team city app . navigation . router . Navigation Router Ċ import Ġcom . github . v ase 4 kin . team city app . navigation . tracker . Navigation Tracker Ċ import Ġcom . github . v ase 4 kin . team city app . navigation . view . Navigation View Ċ import Ġcom . github . v ase 4 kin . team city app . utils . eq Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . hamcrest . core . Is .` is ` Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito .* Ċ import Ġorg . mockito . runners . Mockito JUnit Runner Ċ Ċ @ RunWith ( Mockito JUnit Runner :: class ) Ċ class ĠNavigation Presenter Impl Test Ġ{ ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbuild Type : ĠBuild Type ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnavigation Item : ĠNavigation Item ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġloading Listener : ĠOn Loading Listener < List < Navigation Item >> ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġview : ĠNavigation View ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġdata Manager : ĠNavigation DataManager ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġtracker : ĠNavigation Tracker ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġvalue Extractor : ĠNavigation Value Extractor ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġrouter : ĠNavigation Router ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġpresenter : ĠNavigation Presenter Impl ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter Ġ= ĠNavigation Presenter Impl ( view , Ġdata Manager , Ġtracker , Ġvalue Extractor , Ġrouter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Load Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( value Extractor . id ). thenReturn (" url ") ĊĠĠĠĠĠĠĠ Ġpresenter . load Data ( loading Listener , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġverify ( value Extractor ). id ĊĠĠĠĠĠĠĠ Ġverify ( data Manager ). load ( eq (" url "), Ġeq ( false ), Ġeq ( loading Listener )) ĊĠĠĠĠĠĠĠ Ġverify No More Interactions ( view , Ġdata Manager , Ġtracker , Ġvalue Extractor , Ġrouter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Init Views () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( value Extractor . name ). thenReturn (" name ") ĊĠĠĠĠĠĠĠ Ġpresenter . init Views () ĊĠĠĠĠĠĠĠ Ġverify ( view ). setTitle ( eq (" name ")) ĊĠĠĠĠĠĠĠ Ġverify ( view ). set Navigation Adapter ClickListener ( eq ( presenter )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest CreateModel () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġitems Ġ= Ġempty List < Navigation Item >() ĊĠĠĠĠĠĠĠ ĠassertThat ( presenter . create Model ( items . to Mutable List ()). item Count , Ġ` is `( 0 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest OnClick If Build Type () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( build Type . name ). thenReturn (" name ") ĊĠĠĠĠĠĠĠ Ġ` when `( build Type . getId ()). thenReturn (" id ") ĊĠĠĠĠĠĠĠ Ġpresenter . onClick ( build Type ) ĊĠĠĠĠĠĠĠ Ġverify ( router ). start Build List Activity ( eq (" name "), Ġeq (" id ")) ĊĠĠĠĠĠĠĠ Ġverify No More Interactions ( view , Ġdata Manager , Ġtracker , Ġvalue Extractor , Ġrouter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest OnClick IfNot Build Type () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( navigation Item . name ). thenReturn (" name ") ĊĠĠĠĠĠĠĠ Ġ` when `( navigation Item . getId ()). thenReturn (" id ") ĊĠĠĠĠĠĠĠ Ġpresenter . onClick ( navigation Item ) ĊĠĠĠĠĠĠĠ Ġverify ( router ). start Navigation Activity ( eq (" name "), Ġeq (" id ")) ĊĠĠĠĠĠĠĠ Ġverify No More Interactions ( view , Ġdata Manager , Ġtracker , Ġvalue Extractor , Ġrouter ) ĊĠĠĠ Ġ} Ċ } Ċ