package Ġbr . u fs . hir ing . stone Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . TextView Ċ import Ġbr . u fs . architecture . core . errors . Infrastructure Error Ċ import Ġbr . u fs . architecture . core . errors . Networking Issue . Internet Un reachable Ċ import Ġbr . u fs . hir ing . stone . wallet . Wallet Activity Ċ import Ġkotlinx . android . synt hetic . main . activity _ wallet .* Ċ import Ġkotlinx . android . synt hetic . main . view _ error _ feedback .* Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . Ro bo lectric Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ Ċ /** Ċ Ġ* Ċ Ġ* ĠCreated Ġby Ġ@ ub ir atan f so ares Ċ Ġ* Ċ Ġ*/ Ċ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ class ĠWallet Activity Tests Ġ{ ĊĊĠĠĠ Ġlateinit Ġvar Ġactivity : ĠWallet Activity ĊĊĠĠĠ Ġ@ Before Ġfun Ġ` before Ġeach Ġtest `() Ġ{ ĊĠĠĠĠĠĠĠ Ġactivity Ġ= ĠRo bo lectric . build Activity ( Wallet Activity :: class . java ). create (). get () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġ` should Ġsetup Ġviews Ġproperly Ġat Ġscreen Ġcreation `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ` loading Ġshould Ġnot Ġbe Ġvisible `() ĊĠĠĠĠĠĠĠ Ġ` error Ġrelated Ġviews Ġshould Ġnot Ġbe Ġvisible `() ĊĠĠĠĠĠĠĠ Ġ` recyclerview Ġhas Ġnested Ġscrolling Ġdisabled Ġfor Ġperformance Ġreasons `() ĊĠĠĠĠĠĠĠ Ġ` recyclerview Ġhas Ġlayout manager Ġwith Ġprefetch ing `() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġ` should Ġdeli every Ġactions Ġfor Ġprogress Ġbar Ġcontrol `() Ġ{ ĊĠĠĠĠĠĠĠ Ġactivity . show Loading (). run () ĊĠĠĠĠĠĠĠ Ġ` loading Ġshould Ġbe Ġvisible `() ĊĊĠĠĠĠĠĠĠ Ġactivity . hide Loading (). run () ĊĠĠĠĠĠĠĠ Ġ` loading Ġshould Ġnot Ġbe Ġvisible `() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġ` should Ġdeli every Ġactions Ġfor Ġinfrastructure Ġerror Ġfeedback `() Ġ{ ĊĠĠĠĠĠĠĠ Ġactivity . show Error State ( Infrastructure Error . Remote System Down ). run () ĊĠĠĠĠĠĠĠ Ġ` error Ġfeedback Ġcontainer Ġshould Ġbe Ġvisible `() ĊĠĠĠĠĠĠĠ Ġ` call Ġto Ġaction Ġshould Ġbe Ġvisible Ġwith Ġmessage `( R . string . sn ack text _ un desired _ response ) ĊĊĠĠĠĠĠĠĠ Ġactivity . hide Error State (). run () ĊĠĠĠĠĠĠĠ Ġ` error Ġviews Ġshould Ġbe Ġreset ed `() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġ` should Ġdeli every Ġactions Ġfor Ġinternet Ġerror Ġreport `() Ġ{ ĊĠĠĠĠĠĠĠ Ġactivity . report Networking Error ( Internet Un reachable ). run () ĊĠĠĠĠĠĠĠ Ġ` error Ġfeedback Ġcontainer Ġshould Ġbe Ġvisible `() ĊĠĠĠĠĠĠĠ Ġ` call Ġto Ġaction Ġshould Ġbe Ġvisible Ġwith Ġmessage `( R . string . sn ack text _ internet _ connection ) ĊĊĠĠĠĠĠĠĠ Ġactivity . hide Error State (). run () ĊĠĠĠĠĠĠĠ Ġ` error Ġviews Ġshould Ġbe Ġreset ed `() ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` call Ġto Ġaction Ġshould Ġbe Ġvisible Ġwith Ġmessage `( message Resource : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsn ack Text Ġ= Ġactivity . findViewById < TextView >( R . id . sn ackbar _ text ) ĊĠĠĠĠĠĠĠ ĠassertThat ( sn ack Text ). isNotNull () ĊĊĠĠĠĠĠĠĠ Ġval Ġfeedback Ġ= Ġactivity . getString ( message Resource ) ĊĠĠĠĠĠĠĠ ĠassertThat ( sn ack Text . text ). isEqualTo ( feedback ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` error Ġviews Ġshould Ġbe Ġreset ed `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( activity . feedback Container . visibility ). isEqualTo ( View . GONE ) ĊĠĠĠĠĠĠĠ ĠassertThat ( activity . errorMessage . text ). isEqualTo ("") ĊĠĠĠĠĠĠĠ ĠassertThat ( activity . error Image . drawable ). isNull () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` error Ġfeedback Ġcontainer Ġshould Ġbe Ġvisible `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvisibility Ġ= Ġactivity . feedback Container . visibility ĊĠĠĠĠĠĠĠ ĠassertThat ( visibility ). isEqualTo ( View . VISIBLE ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` error Ġrelated Ġviews Ġshould Ġnot Ġbe Ġvisible `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvisibility Ġ= Ġactivity . feedback Container . visibility ĊĠĠĠĠĠĠĠ ĠassertThat ( visibility ). isEqualTo ( View . GONE ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` loading Ġshould Ġnot Ġbe Ġvisible `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( activity . pull To Refresh . isEnabled ). isTrue () ĊĠĠĠĠĠĠĠ ĠassertThat ( activity . pull To Refresh . is Refresh ing ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` loading Ġshould Ġbe Ġvisible `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( activity . pull To Refresh . is Refresh ing ). isTrue () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` recyclerview Ġhas Ġnested Ġscrolling Ġdisabled Ġfor Ġperformance Ġreasons `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( activity . wallet Views . is Nested Scrolling Enabled ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġ` recyclerview Ġhas Ġlayout manager Ġwith Ġprefetch ing `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlayout Manager Ġ= Ġactivity . wallet Views . layout Manager ĊĠĠĠĠĠĠĠ ĠassertThat ( layout Manager . is Item Pref etch Enabled ). isTrue () ĊĠĠĠĠĠĠĠ ĠassertThat ( layout Manager . is Auto Measure Enabled ). isTrue () ĊĠĠĠ Ġ} Ċ Ċ }