package Ġ` in `. test press . test press . fragment Ċ Ċ import Ġ` in `. test press . test press . R Ċ import Ġ` in `. test press . test press . auth enticator . Register Activity Ċ import Ġ` in `. test press . test press . ui . fragments . Email Verification Fragment Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġandroidx . test . rule . Activity Test Rule Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠEmail Verification Fragment Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġtest Activity Rule Ġ= ĠActivity Test Rule ( Register Activity :: class . java , Ġtrue , Ġtrue ) ĊĊĠĠĠ Ġ@ Rule ĊĠĠĠ Ġfun Ġrule () Ġ= Ġtest Activity Rule ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġemail Verification Fragment : ĠEmail Verification Fragment ĊĊĠĠĠ Ġvar Ġis Register Success Ful Ġ= Ġfalse ĊĊĠĠĠ Ġprivate Ġval ĠVIS IBLE Ġ= Ġ 1 ĊĊĠĠĠ Ġprivate Ġval ĠIN VISIBLE Ġ= Ġ 0 ĊĊĠĠĠ Ġprivate Ġvar Ġregister Layout Ġ= ĠIN VISIBLE ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġemail Verification Fragment Ġ= ĠEmail Verification Fragment () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Navigate To Email Verification Fragment The View Should Not BeNull () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Activity Rule . activity . navigate To Email Verification Fragment () ĊĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( test Activity Rule . activity . findViewById ( R . id . container )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Register Successful It Should Show Verify Email Layout () Ġ{ ĊĠĠĠĠĠĠĠ Ġemail Verification Fragment . activity Ġ= Ġtest Activity Rule . activity ĊĠĠĠĠĠĠĠ Ġis Register Success Ful Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġemail Verification Fragment . perform Register () ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( VISIBLE , Ġregister Layout ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Register Failed It Should Hide Verify Email Layout () Ġ{ ĊĠĠĠĠĠĠĠ Ġemail Verification Fragment . activity Ġ= Ġtest Activity Rule . activity ĊĠĠĠĠĠĠĠ Ġis Register Success Ful Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġemail Verification Fragment . perform Register () ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( IN VISIBLE , Ġregister Layout ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠEmail Verification Fragment . perform Register () Ġ{ ĊĠĠĠĠĠĠ Ġemail Verification Fragment . show Verify Email Layout () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠEmail Verification Fragment . show Verify Email Layout (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( is Register Success Ful ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġregister Layout Ġ= ĠVIS IBLE ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġregister Layout ĊĠĠĠ Ġ} Ċ Ċ } Ċ