package Ġcom . car los di est ro . job application manager . ui . fragments Ċ Ċ import Ġandroidx . navigation . Nav Controller Ċ import Ġandroidx . navigation . Navigation Ċ import Ġandroidx . test . espress o . Esp ress o . on View Ċ import Ġandroidx . test . espress o . action . View Actions . click Ċ import Ġandroidx . test . espress o . assertion . View Assertions . does NotExist Ċ import Ġandroidx . test . espress o . assertion . View Assertions . matches Ċ import Ġandroidx . test . espress o . contrib . RecyclerView Actions . action On Item At Position Ċ import Ġandroidx . test . espress o . matcher . View Matchers .* Ċ import Ġandroidx . test . filters . Medium Test Ċ import Ġcom . car los di est ro . job application manager . R Ċ import Ġcom . car los di est ro . job application manager . datasource . Fake Job Application Data Ċ import Ġcom . car los di est ro . job application manager . ui . adapters . Job Application Adapter Ċ import Ġcom . car los di est ro . job application manager . utils . launch Fragment In H ilt Container Ċ import Ġcom . google . gson . Gson Ċ import Ġdagger . h ilt . android . testing . H ilt Android Rule Ċ import Ġdagger . h ilt . android . testing . H ilt Android Test Ċ import Ġkotlinx . coroutines . Experimental Cor outines Api Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mockito . mock Ċ import Ġorg . mockito . Mockito . verify Ċ Ċ @ Medium Test Ċ @ H ilt Android Test Ċ @ Experimental Cor outines Api Ċ class ĠJob Applications Fragment Test Ġ{ ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġvar Ġh ilt Rule Ġ= ĠH ilt Android Rule ( this ) ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ Ġh ilt Rule . inject () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick Clean Non Pending Job Applications _ open Dialog Warning () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ clean )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . clean _ alert _ dialog _ title )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick Warning Dialog Negative Button _ dismiss Dialog Warning () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ clean )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . clean _ alert _ dialog _ negative _ button _ text )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . clean _ alert _ dialog _ title )). check ( does NotExist ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick Filter Job Applications _ open Filter Menu () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ filter )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . status _ filter _ menu _ all )). check ( matches ( is Displayed ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick All Filter _ filter Job Applications By All () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ filter )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . status _ filter _ menu _ all )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . txt _ show _ filter )). check ( matches ( with Text ( R . string . status _ filter _ menu _ all ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick Pending Filter _ filter Job Applications By All () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ filter )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . status _ filter _ menu _ pending )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . txt _ show _ filter )). check ( matches ( with Text ( R . string . status _ filter _ menu _ pending ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick Accepted Filter _ filter Job Applications By All () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ filter )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . status _ filter _ menu _ accepted )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . txt _ show _ filter )). check ( matches ( with Text ( R . string . status _ filter _ menu _ accepted ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick Rejected Filter _ filter Job Applications By All () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ filter )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Text ( R . string . status _ filter _ menu _ rejected )). perform ( click ()) ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . txt _ show _ filter )). check ( matches ( with Text ( R . string . status _ filter _ menu _ rejected ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġclick At Add Job Application Item Button _ navigate To New Job Application Fragment () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġmock ( Nav Controller :: class . java ) ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNavigation . setView Nav Controller ( require View (), Ġnav Controller ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . btn _ new _ application )). perform ( click ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( nav Controller ). navigate ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJob Applications Fragment Directions . job Applications To New Job Application ("") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval ĠLIST _ ITEM _ IN _ TEST Ġ= Ġ 4 ĊĠĠĠ Ġprivate Ġval ĠJOB _ APPLICATION _ IN _ TEST Ġ= ĠFake Job Application Data . job Applications [ 4 ] ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġis RecyclerView In visible _ on App Launch And Empty Job Applications () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . rv _ job _ applications )). check ( matches ( with Effective Visibility ( Visibility . IN VISIBLE ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġselect Job Application _ isNew Job Application Fragment Visible () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġmock ( Nav Controller :: class . java ) ĊĠĠĠĠĠĠĠ Ġlaunch Fragment In H ilt Container < Job Applications Fragment > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNavigation . setView Nav Controller ( require View (), Ġnav Controller ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġon View ( with Id ( R . id . rv _ job _ applications )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. perform ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaction On Item At Position < Job Application Adapter . Job Application ViewHolder >( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLIST _ ITEM _ IN _ TEST , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclick () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġverify ( nav Controller ). navigate ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJob Applications Fragment Directions . job Applications To New Job Application ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠGson (). toJson ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠJOB _ APPLICATION _ IN _ TEST ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ }