package Ġcom . is up atches . wise fy Ċ Ċ import Ġandroid . net . Network Info Ċ import Ġcom . is up atches . wise fy . callbacks . GetCurrent Network Info Callbacks Ċ import Ġcom . is up atches . wise fy . constants . MISSING _ PARAMETER Ċ import Ġcom . is up atches . wise fy . internal . base . Base Instrumentation Test Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Assert . assertNotNull Ċ import Ġorg . junit . Assert . fail Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mockito . mock Ċ import Ġorg . mockito . Mockito . timeout Ċ import Ġorg . mockito . Mockito . verify Ċ Ċ /** Ċ Ġ* ĠTests Ġthe Ġability Ġto Ġretrieve Ġa Ġdevice 's Ġcurrent Ġnetwork Ġinformation . Ċ Ġ* Ċ Ġ* Ġ@ author ĠPat ches Ċ Ġ* Ġ@ since Ġ 3 . 0 Ċ Ġ*/ Ċ internal Ġclass ĠGetCurrent Network Info Test Ġ: ĠBase Instrumentation Test () Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsync _ failure _ pre checks () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ failure () ĊĠĠĠĠĠĠĠ ĠassertEquals ( null , Ġwise fy . getCurrent Network Info ()) ĊĠĠĠĠĠĠĠ Ġverification Util . did Not Try To GetCurrent Network Info () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsync _ failure _ null Current Network () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( null , Ġwise fy . getCurrent Network Info ()) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed To GetCurrent Network Info () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsync _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . active Network () ĊĠĠĠĠĠĠĠ Ġval Ġcurrent Network Info Ġ= Ġwise fy . getCurrent Network Info () ĊĠĠĠĠĠĠĠ Ġif Ġ( current Network Info Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertNotNull ( current Network Info ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġverification Util . tri ed To GetCurrent Network Info () ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfail () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure _ pre checks () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ failure () ĊĠĠĠĠĠĠĠ Ġval Ġmock Callbacks Ġ= Ġmock ( GetCurrent Network Info Callbacks :: class . java ) ĊĠĠĠĠĠĠĠ Ġwise fy . getCurrent Network Info ( mock Callbacks ) ĊĠĠĠĠĠĠĠ Ġverify ( mock Callbacks , Ġtimeout ( VER IFICATION _ SUCCESS _ TIMEOUT )). wise fy Failure ( MISSING _ PARAMETER ) ĊĠĠĠĠĠĠĠ Ġverification Util . did Not Try To GetCurrent Network Info () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure _ pre checks _ null Callbacks () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ failure () ĊĠĠĠĠĠĠĠ Ġnull Callback Util . call GetCurrent Network Info () ĊĠĠĠĠĠĠĠ Ġverification Util . did Not Try To GetCurrent Network Info () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure _ null Current Network () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ success () ĊĠĠĠĠĠĠĠ Ġval Ġmock Callbacks Ġ= Ġmock ( GetCurrent Network Info Callbacks :: class . java ) ĊĠĠĠĠĠĠĠ Ġwise fy . getCurrent Network Info ( mock Callbacks ) ĊĠĠĠĠĠĠĠ Ġverify ( mock Callbacks , Ġtimeout ( VER IFICATION _ SUCCESS _ TIMEOUT )). no Current Network Info () ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed To GetCurrent Network Info () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ failure _ null Current Network _ null Callbacks () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ success () ĊĠĠĠĠĠĠĠ Ġnull Callback Util . call GetCurrent Network Info () ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed To GetCurrent Network Info () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . active Network () ĊĠĠĠĠĠĠĠ Ġval Ġmock Callbacks Ġ= Ġmock ( GetCurrent Network Info Callbacks :: class . java ) ĊĠĠĠĠĠĠĠ Ġwise fy . getCurrent Network Info ( mock Callbacks ) ĊĠĠĠĠĠĠĠ Ġverify ( mock Callbacks , Ġtimeout ( VER IFICATION _ SUCCESS _ TIMEOUT )). retrie ved Current Network Info ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġany ( Network Info :: class . java ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed To GetCurrent Network Info () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġasync _ success _ null Callback () Ġ{ ĊĠĠĠĠĠĠĠ Ġmock Wise Fy Pre checks Util . getCurrent Network Info _ success () ĊĠĠĠĠĠĠĠ Ġmock Network Util . active Network () ĊĠĠĠĠĠĠĠ Ġnull Callback Util . call GetCurrent Network Info () ĊĠĠĠĠĠĠĠ Ġverification Util . tri ed To GetCurrent Network Info () ĊĠĠĠ Ġ} Ċ } Ċ