package Ġfr . free . n rw . commons . near by Ċ Ċ import Ġandroid . app . AlertDialog Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . res . Configuration Ċ import Ġandroid . net . Uri Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . widget . ImageView Ċ import Ġandroid . widget . LinearLayout Ċ import Ġandroid . widget . Relative Layout Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . appcompat . widget . AppCompat ImageView Ċ import Ġandroidx . coordinator layout . widget . Coordinator Layout Ċ import Ġandroidx . fragment . app . FragmentManager Ċ import Ġandroidx . fragment . app . Fragment Transaction Ċ import Ġcom . google . android . material . bottom sheet . Bottom Sheet Behavior Ċ import Ġcom . google . android . material . floating action button . Floating ActionButton Ċ import Ġcom . mapbox . mapbox sdk . camera . Camera Position Ċ import Ġcom . mapbox . mapbox sdk . camera . Camera Update Factory Ċ import Ġcom . mapbox . mapbox sdk . geometry . LatLng Ċ import Ġcom . mapbox . mapbox sdk . maps . MapView Ċ import Ġcom . mapbox . mapbox sdk . maps . Map box Map Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . verify Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . wh enever Ċ import Ġfr . free . n rw . commons . R Ċ import Ġfr . free . n rw . commons . Test App Adapter Ċ import Ġfr . free . n rw . commons . Test Common s Application Ċ import Ġfr . free . n rw . commons . bookmarks . locations . Bookmark Locations Dao Ċ import Ġfr . free . n rw . commons . cont ributions . MainActivity Ċ import Ġfr . free . n rw . commons . kv store . Json Kv Store Ċ import Ġfr . free . n rw . commons . location . Location Service Manager Ċ import Ġfr . free . n rw . commons . location . Location Service Manager . Location Change Type Ċ import Ġfr . free . n rw . commons . near by . fragments . Near by Parent Fragment Ċ import Ġfr . free . n rw . commons . near by . presenter . Near by Parent Fragment Presenter Ċ import Ġfr . free . n rw . commons . wik idata . W ik idata Edit Listener Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito .* Ċ import Ġorg . mockito . Mockito Annotations Ċ import Ġorg . power mock . reflect . White box Ċ import Ġorg . ro bo lectric . Ro bo lectric Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ import Ġorg . ro bo lectric . Runtime Environment Ċ import Ġorg . ro bo lectric . Shadow s Ċ import Ġorg . ro bo lectric . annotation . Config Ċ import Ġorg . ro bo lectric . annotation . Looper Mode Ċ import Ġorg . ro bo lectric . shadow s . Shadow Activity Ċ import Ġorg . ro bo lectric . shadow s . Shadow AlertDialog Ċ import Ġorg . wikipedia . App Adapter Ċ import Ġjava . lang . reflect . Method Ċ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ @ Config ( sdk Ġ= Ġ[ 2 1 ], Ġapplication Ġ= ĠTest Common s Application :: class ) Ċ @ Looper Mode ( Looper Mode . Mode . PA USED ) Ċ class ĠN ear by Parent Fragment UnitTest Ġ{ ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġmap View : ĠMap View ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġapplication Kv Store : ĠJson Kv Store ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġmap Box : ĠMap box Map ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġpresenter : ĠN ear by Parent Fragment Presenter ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġview : ĠView ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġiv Toggle Chips : ĠAppCompat ImageView ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġconfiguration : ĠConfiguration ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġrl Bottom Sheet : ĠRelative Layout ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġrl Bottom Sheet LayoutParams : ĠViewGroup . LayoutParams ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnearby Parent Fragment Instance Ready Callback : ĠN ear by Parent Fragment . Near by Parent Fragment Instance Ready Callback ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbottom Sheet Behavior : ĠBottom Sheet Behavior < View > ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġlocation Manager : ĠLocation Service Manager ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġw ik idata Edit Listener : ĠW ik idata Edit Listener ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġfab : ĠFloating ActionButton ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbottom Sheet Details : ĠView ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġmarker : ĠN ear by Marker ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġlinear Layout : ĠLinearLayout ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠtextView : ĠTextView ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠimageView : ĠImageView ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbookmark Location Dao : ĠBook mark Locations Dao ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġlayout Inflater : ĠLayoutInflater ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġfragment : ĠN ear by Parent Fragment ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġfragment Manager : ĠFragment Manager ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġcontext : ĠContext ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġactivity : ĠMainActivity ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠĠĠĠĠĠĠ Ġcontext Ġ= ĠRuntime Environment . application . application Context ĊĊĠĠĠĠĠĠĠ ĠApp Adapter . set ( Test App Adapter ()) ĊĠĠĠĠĠĠĠ Ġactivity Ġ= ĠRo bo lectric . build Activity ( MainActivity :: class . java ). create (). get () ĊĊĠĠĠĠĠĠĠ Ġfragment Ġ= ĠN ear by Parent Fragment () ĊĠĠĠĠĠĠĠ Ġfragment Manager Ġ= Ġactivity . support FragmentManager ĊĠĠĠĠĠĠĠ Ġval Ġfragment Transaction : ĠFragment Transaction Ġ= Ġfragment Manager . beginTransaction () ĊĠĠĠĠĠĠĠ Ġfragment Transaction . add ( fragment , Ġnull ) ĊĠĠĠĠĠĠĠ Ġfragment Transaction . commit Now Allow ing State Loss () ĊĊĠĠĠĠĠĠĠ Ġlayout Inflater Ġ= ĠLayoutInflater . from ( activity ) ĊĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" map View ", Ġmap View ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" application Kv Store ", Ġapplication Kv Store ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" map Box ", Ġmap Box ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" presenter ", Ġpresenter ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" ll Container Chips ", Ġview ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" iv Toggle Chips ", Ġiv Toggle Chips ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" rl Bottom Sheet ", Ġrl Bottom Sheet ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" isVisible To User ", Ġtrue ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" bottom Sheet List Behavior ", Ġbottom Sheet Behavior ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" bottom Sheet Details Behavior ", Ġbottom Sheet Behavior ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" location Manager ", Ġlocation Manager ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" wik idata Edit Listener ", Ġw ik idata Edit Listener ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" fab Plus ", Ġfab ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" fab Camera ", Ġfab ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" fab Gallery ", Ġfab ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" fab Gallery ", Ġfab ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" bottom Sheet Details ", Ġbottom Sheet Details ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" transparent View ", Ġview ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" bookmark Button ", Ġlinear Layout ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" wikipedia Button ", Ġlinear Layout ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" wik idata Button ", Ġlinear Layout ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" directions Button ", Ġlinear Layout ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" commons Button ", Ġlinear Layout ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" bookmark Location Dao ", Ġbookmark Location Dao ) ĊĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" icon ", ĠimageView ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" title ", ĠtextView ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" distance ", ĠtextView ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" description ", ĠtextView ) ĊĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" near by Parent Fragment Instance Ready Callback ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnearby Parent Fragment Instance Ready Callback ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġ` Start Ġmap Ġwithout Ġgps Ġtest Ġwhen Ġlast Ġlocation Ġknown `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmethod : ĠMethod Ġ= ĠN ear by Parent Fragment :: class . java . getDeclared Method ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" start Map With Condition ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠString :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġmethod . is Accessible Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġmethod . invoke ( fragment , Ġ" Without ĠGPS ") ĊĠĠĠĠĠĠĠ Ġverify ( map View , Ġtimes ( 1 )). onStart () ĊĠĠĠĠĠĠĠ Ġverify ( application Kv Store , Ġtimes ( 1 )). getString (" Last Location ") ĊĠĠĠĠĠĠĠ Ġverify ( presenter , Ġtimes ( 1 )). on Map Ready () ĊĠĠĠĠĠĠĠ Ġval Ġposition Ġ= ĠCamera Position . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. target ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLat Lng ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 5 1 . 5 0 5 5 0 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ- 0 . 0 7 5 2 0 , Ġ 0 . 0 ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. zoom ( 0 . 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġverify ( map Box , Ġtimes ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. move Camera ( Camera Update Factory . new Camera Position ( position )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġ` Start Ġmap Ġwithout Ġgps Ġtest Ġwhen Ġlast Ġlocation Ġunknown `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( application Kv Store . getString (" Last Location ")). thenReturn (" 2 3 . 7 6 , 5 6 . 8 7 6 ") ĊĠĠĠĠĠĠĠ Ġval Ġmethod : ĠMethod Ġ= ĠN ear by Parent Fragment :: class . java . getDeclared Method ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" start Map With Condition ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠString :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġmethod . is Accessible Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġmethod . invoke ( fragment , Ġ" Without ĠGPS ") ĊĠĠĠĠĠĠĠ Ġverify ( map View , Ġtimes ( 1 )). onStart () ĊĠĠĠĠĠĠĠ Ġverify ( application Kv Store , Ġtimes ( 2 )). getString (" Last Location ") ĊĠĠĠĠĠĠĠ Ġverify ( presenter , Ġtimes ( 1 )). on Map Ready () ĊĠĠĠĠĠĠĠ Ġval Ġposition Ġ= ĠCamera Position . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. target ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLat Lng ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 2 3 . 7 6 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 5 6 . 8 7 6 , Ġ 0 . 0 ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. zoom ( 1 4 . 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġverify ( map Box , Ġtimes ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. move Camera ( Camera Update Factory . new Camera Position ( position )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġ` Start Ġmap Ġwithout Ġlocation Ġpermission Ġtest Ġwhen Ġlast Ġlocation Ġknown `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmethod : ĠMethod Ġ= ĠN ear by Parent Fragment :: class . java . getDeclared Method ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" start Map With Condition ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠString :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġmethod . is Accessible Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġmethod . invoke ( fragment , Ġ" Without ĠPermission ") ĊĠĠĠĠĠĠĠ Ġverify ( map View , Ġtimes ( 1 )). onStart () ĊĠĠĠĠĠĠĠ Ġverify ( application Kv Store , Ġtimes ( 1 )). getString (" Last Location ") ĊĠĠĠĠĠĠĠ Ġverify ( application Kv Store , Ġtimes ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. put Boolean (" do Not Ask For Location Permission ", Ġtrue ) ĊĠĠĠĠĠĠĠ Ġverify ( presenter , Ġtimes ( 1 )). on Map Ready () ĊĠĠĠĠĠĠĠ Ġval Ġposition Ġ= ĠCamera Position . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. target ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLat Lng ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 5 1 . 5 0 5 5 0 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ- 0 . 0 7 5 2 0 , Ġ 0 . 0 ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. zoom ( 0 . 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġverify ( map Box , Ġtimes ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. move Camera ( Camera Update Factory . new Camera Position ( position )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġ` Start Ġmap Ġwithout Ġlocation Ġpermission Ġtest Ġwhen Ġlast Ġlocation Ġunknown `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( application Kv Store . getString (" Last Location ")). thenReturn (" 2 3 . 7 6 , 5 6 . 8 7 6 ") ĊĠĠĠĠĠĠĠ Ġval Ġmethod : ĠMethod Ġ= ĠN ear by Parent Fragment :: class . java . getDeclared Method ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" start Map With Condition ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠString :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġmethod . is Accessible Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġmethod . invoke ( fragment , Ġ" Without ĠPermission ") ĊĠĠĠĠĠĠĠ Ġverify ( map View , Ġtimes ( 1 )). onStart () ĊĠĠĠĠĠĠĠ Ġverify ( application Kv Store , Ġtimes ( 2 )). getString (" Last Location ") ĊĠĠĠĠĠĠĠ Ġverify ( application Kv Store , Ġtimes ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. put Boolean (" do Not Ask For Location Permission ", Ġtrue ) ĊĠĠĠĠĠĠĠ Ġverify ( presenter , Ġtimes ( 1 )). on Map Ready () ĊĠĠĠĠĠĠĠ Ġval Ġposition Ġ= ĠCamera Position . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. target ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLat Lng ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 2 3 . 7 6 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 5 6 . 8 7 6 , Ġ 0 . 0 ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. zoom ( 1 4 . 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġverify ( map Box , Ġtimes ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. move Camera ( Camera Update Factory . new Camera Position ( position )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest On Toggle Chips Clicked Case Visible () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( view . visibility ). thenReturn ( View . VISIBLE ) ĊĠĠĠĠĠĠĠ Ġfragment . on Toggle Chips Clicked () ĊĠĠĠĠĠĠĠ Ġverify ( view ). visibility Ġ= ĠView . GONE ĊĠĠĠĠĠĠĠ Ġverify ( iv Toggle Chips ). rotation Ġ= Ġiv Toggle Chips . rotation Ġ+ Ġ 1 8 0 ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest On Toggle Chips Clicked Case Not Visible () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( view . visibility ). thenReturn ( View . GONE ) ĊĠĠĠĠĠĠĠ Ġfragment . on Toggle Chips Clicked () ĊĠĠĠĠĠĠĠ Ġverify ( view ). visibility Ġ= ĠView . VISIBLE ĊĠĠĠĠĠĠĠ Ġverify ( iv Toggle Chips ). rotation Ġ= Ġiv Toggle Chips . rotation Ġ+ Ġ 1 8 0 ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest On Learn More Clicked () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . on Learn More Clicked () ĊĠĠĠĠĠĠĠ Ġval Ġshadow Activity : ĠShadow Activity Ġ= ĠShadow s . shadow Of ( activity ) ĊĠĠĠĠĠĠĠ Ġval Ġstarted Intent Ġ= Ġshadow Activity . next Started Activity ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( started Intent .` data `, ĠUri . parse ( Near by Parent Fragment . WL M _ URL )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest On Configuration Changed () Ġ{ ĊĠĠĠĠĠĠĠ Ġ` when `( rl Bottom Sheet . layout Params ). thenReturn ( rl Bottom Sheet LayoutParams ) ĊĠĠĠĠĠĠĠ Ġfragment . on Configuration Changed ( configuration ) ĊĠĠĠĠĠĠĠ Ġverify ( rl Bottom Sheet ). layout Params ĊĠĠĠĠĠĠĠ Ġverify ( rl Bottom Sheet ). layout Params Ġ= Ġrl Bottom Sheet LayoutParams ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Set Near by Parent Fragment Instance Ready Callback () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . set Near by Parent Fragment Instance Ready Callback ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnearby Parent Fragment Instance Ready Callback ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnearby Parent Fragment Instance Ready Callback , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnearby Parent Fragment Instance Ready Callback ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Set User Visible Hint Case False () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmethod : ĠMethod Ġ= ĠN ear by Parent Fragment :: class . java . getDeclared Method ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" setUser Visible Hint ", ĠBoolean :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġmethod . is Accessible Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġmethod . invoke ( fragment , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġverify ( bottom Sheet Behavior , Ġtimes ( 2 )). state Ġ= ĠBottom Sheet Behavior . STATE _ HIDDEN ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Set User Visible Hint Case True () Ġ{ ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" m State ", Ġ 4 ) ĊĠĠĠĠĠĠĠ Ġval Ġmethod : ĠMethod Ġ= ĠN ear by Parent Fragment :: class . java . getDeclared Method ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" setUser Visible Hint ", ĠBoolean :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġmethod . is Accessible Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġmethod . invoke ( fragment , Ġtrue ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Register Unregister Location Listener Case True () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . register Unregister Location Listener ( true ) ĊĠĠĠĠĠĠĠ Ġverify ( location Manager ). unregister Location Manager () ĊĠĠĠĠĠĠĠ Ġverify ( location Manager ). remove Location Listener ( fragment ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Register Unregister Location Listener Case False () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . register Unregister Location Listener ( false ) ĊĠĠĠĠĠĠĠ Ġverify ( location Manager ). add Location Listener ( fragment ) ĊĠĠĠĠĠĠĠ Ġverify ( location Manager ). register Location Manager () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest On W ik idata Edit Successful () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . on W ik idata Edit Successful () ĊĠĠĠĠĠĠĠ Ġverify ( presenter ). update Map And List ( Location Change Type . MAP _ UPDATED ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest On Destroy () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . on Destroy () ĊĠĠĠĠĠĠĠ Ġverify ( wik idata Edit Listener ). set Authentication State Listener ( null ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Prepare Views For Sheet Position Case Collapsed () Ġ{ ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" is FAB s Expanded ", Ġtrue ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" m View ", Ġview ) ĊĠĠĠĠĠĠĠ Ġwhenever ( view . findViewById ( R . id . empty _ view ) Ġas ĠView ?). thenReturn ( view ) ĊĠĠĠĠĠĠĠ Ġwhenever ( view . findViewById ( R . id . empty _ view 1 ) Ġas ĠView ?). thenReturn ( view ) ĊĠĠĠĠĠĠĠ Ġwhenever ( view . id ). thenReturn ( 0 ) ĊĠĠĠĠĠĠĠ Ġfragment . prepare Views For Sheet Position ( Bottom Sheet Behavior . STATE _ COLL AP SED ) ĊĠĠĠĠĠĠĠ Ġverify ( fab ). is Shown ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Prepare Views For Sheet Position Case Hidden () Ġ{ ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" is FAB s Expanded ", Ġtrue ) ĊĠĠĠĠĠĠĠ ĠWhite box . set Internal State ( fragment , Ġ" m View ", Ġview ) ĊĠĠĠĠĠĠĠ Ġwhenever ( view . findViewById ( R . id . empty _ view ) Ġas ĠView ?). thenReturn ( view ) ĊĠĠĠĠĠĠĠ Ġwhenever ( view . findViewById ( R . id . empty _ view 1 ) Ġas ĠView ?). thenReturn ( view ) ĊĠĠĠĠĠĠĠ Ġwhenever ( view . id ). thenReturn ( 0 ) ĊĠĠĠĠĠĠĠ Ġwhenever ( fab . layout Params ). thenReturn ( mock ( Coordinator Layout . LayoutParams :: class . java )) ĊĠĠĠĠĠĠĠ Ġfragment . prepare Views For Sheet Position ( Bottom Sheet Behavior . STATE _ HIDDEN ) ĊĠĠĠĠĠĠĠ Ġverify ( fab , Ġtimes ( 5 )). hide () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Display Bottom Sheet With Info () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnearby Base Marker Ġ= Ġmock ( Near by Base Marker :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġplace Ġ= Ġmock ( Place :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġlabel Ġ= Ġmock ( Label :: class . java ) ĊĠĠĠĠĠĠĠ Ġwhenever ( marker . near by Base Marker ). thenReturn ( near by Base Marker ) ĊĠĠĠĠĠĠĠ Ġwhenever ( near by Base Marker . place ). thenReturn ( place ) ĊĠĠĠĠĠĠĠ Ġwhenever ( place . label ). thenReturn ( label ) ĊĠĠĠĠĠĠĠ Ġwhenever ( place . long Description ). thenReturn ("") ĊĠĠĠĠĠĠĠ Ġfragment . display Bottom Sheet With Info ( marker ) ĊĠĠĠĠĠĠĠ Ġverify ( bottom Sheet Behavior ). state Ġ= ĠBottom Sheet Behavior . STATE _ COLL AP SED ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Open Location Settings Case Null () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . open Location Settings () ĊĠĠĠĠĠĠĠ Ġval Ġshadow Activity : ĠShadow Activity Ġ= ĠShadow s . shadow Of ( activity ) ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( shadow Activity . next Started Activity For Result , Ġnull ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġtest Show Location Off Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment . show Location Off Dialog () ĊĠĠĠĠĠĠĠ Ġval Ġdialog : ĠAlertDialog Ġ= ĠShadow AlertDialog . get Latest Dialog () Ġas ĠAlertDialog ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( dialog . is Showing , Ġtrue ) ĊĠĠĠ Ġ} Ċ Ċ }