package Ġcom . vl ad 1 m 1 r . lem nis cate . fun ny Ċ Ċ import Ġandroid . os . Build Ċ import Ġandroidx . test . platform . app . Instrumentation Registry Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . mock Ċ import Ġcom . vl ad 1 m 1 r . lem nis cate . test utils . Test Constants Ċ import Ġcom . vl ad 1 m 1 r . lem nis cate . test utils . is Periodic Ċ import Ġcom . vl ad 1 m 1 r . lem nis cate . test utils . setup Default Mock Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ import Ġorg . ro bo lectric . annotation . Config Ċ import Ġkotlin . math . PI Ċ Ċ class ĠHeart Progress View Test { ĊĊĠĠĠ Ġprivate Ġval Ġview Ġ= Ġmock < Heart Progress View >() ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġview . setup Default Mock () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Graph X () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph X ( 0 . 0 f )). is Within ( Test Constants . DELTA ). of ( 0 . 0 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph X ( 0 . 1 f )). is Within ( Test Constants . DELTA ). of ( 0 . 0 4 6 8 2 4 0 4 5 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph X ( 0 . 5 f )). is Within ( Test Constants . DELTA ). of ( 5 . 1 8 5 6 6 6 6 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph X ( 1 . 0 f )). is Within ( Test Constants . DELTA ). of ( 2 8 . 0 3 8 7 3 6 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph X ( PI . toFloat ())). is Within ( Test Constants . DELTA ). of ( 0 . 0 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph X ( 2 . 0 f )). is Within ( Test Constants . DELTA ). of ( 3 5 . 3 8 0 0 9 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph X ( 2 Ġ* ĠPI . toFloat ())). is Within ( Test Constants . DELTA ). of ( 0 . 0 f ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Graph Y () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph Y ( 0 . 0 f )). is Within ( Test Constants . DELTA ). of (- 1 4 . 7 0 5 8 8 2 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph Y ( 0 . 1 f )). is Within ( Test Constants . DELTA ). of (- 1 5 . 3 0 2 9 0 3 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph Y ( 0 . 5 f )). is Within ( Test Constants . DELTA ). of (- 2 6 . 4 1 6 8 6 4 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph Y ( 1 . 0 f )). is Within ( Test Constants . DELTA ). of (- 3 4 . 5 2 4 3 9 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph Y ( PI . toFloat ())). is Within ( Test Constants . DELTA ). of ( 5 0 . 0 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph Y ( 2 . 0 f )). is Within ( Test Constants . DELTA ). of ( 1 1 . 5 1 9 2 1 f ) ĊĠĠĠĠĠĠĠ ĠassertThat ( view . get Graph Y ( 2 Ġ* ĠPI . toFloat ())). is Within ( Test Constants . DELTA ). of (- 1 4 . 7 0 5 8 8 2 f ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġis Periodic () Ġ{ ĊĠĠĠĠĠĠĠ Ġview . is Periodic ( 2 Ġ* ĠPI . toFloat ()) ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ @ Config ( sdk Ġ= Ġ[ Build . VERSION _ CODES . P ]) Ċ class ĠHeart Progress View Has Hole Test Ġ{ ĊĊĠĠĠ Ġval Ġcontext Ġ= ĠInstrument ation Registry . get Instrumentation (). target Context ĊĠĠĠ Ġprivate Ġval Ġview Ġ= ĠHeart Progress View ( context ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġhas Hole Disabled () Ġ{ ĊĠĠĠĠĠĠĠ Ġview . has Hole Ġ= Ġtrue ĊĠĠĠĠĠĠĠ ĠassertThat ( view . has Hole ). isFalse () ĊĠĠĠ Ġ} Ċ } Ċ