package Ġl uc asc amp os . labs . core . widgets Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . graphics . drawable . Drawable Ċ import Ġandroid . graphics . drawable . Gradient Drawable Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . test . core . app . Application Provider Ċ import Ġl uc asc amp os . labs . core . R Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ class ĠUnexpected Error View Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġsut : ĠUnexpected Error View ĊĊĠĠĠ Ġprivate Ġval Ġcontext Ġ= ĠApplication Provider . getApplicationContext < Context >() ĊĊĠĠĠ Ġprivate Ġval Ġicon : ĠTextView ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġsut . findViewById ( R . id . icon ) ĊĊĠĠĠ Ġprivate Ġval Ġmessage : ĠTextView ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġsut . findViewById ( R . id . message ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġgiven Unexpected Error View _ When Create _ Then Message ShouldBe Correct () Ġ{ ĊĠĠĠĠĠĠĠ Ġsut Ġ= ĠUnexpected Error View ( context ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( context . getString ( R . string . view _ error _ unexpected _ message ), Ġmessage . text ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġgiven Unexpected Error View _ When Create _ Then Icon ShouldBe Correct () Ġ{ ĊĠĠĠĠĠĠĠ Ġsut Ġ= ĠUnexpected Error View ( context ) ĊĊĠĠĠĠĠĠĠ Ġval Ġexpected Ġ= Ġcontext . get Drawable ( R . drawable . bg _ circle _ red ) !!. to Gradient () ĊĠĠĠĠĠĠĠ Ġval Ġsut Background Ġ= Ġicon . background . to Gradient () ĊĊĠĠĠĠĠĠĠ ĠassertEquals (" X ", Ġicon . text ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( expected . color , Ġsut Background . color ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( expected . shape , Ġsut Background . shape ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠDrawable . to Gradient () Ġ= Ġthis Ġas ĠGradient Drawable Ċ Ċ }