package Ġcom . ke val p ate l 2 1 0 6 . y ip . dashboard Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . content . res . Resources Ċ import Ġandroidx . arch . core . executor . testing . Instant Task Executor Rule Ċ import Ġcom . flex trade . k fixture . K Fixture Ċ import Ġcom . flex trade . k fixture . custom isation . Ignore Default ArgsConstructor Custom isation Ċ import Ġcom . ke val p ate l 2 1 0 6 . test utils . Rx Schedulers Override Rule Ċ import Ġcom . ke val p ate l 2 1 0 6 . y ip . R Ċ import Ġcom . ke val p ate l 2 1 0 6 . y ip . entity . Deadline Ċ import Ġcom . ke val p ate l 2 1 0 6 . y ip . repo . billing Repo . Billing Repo Ċ import Ġcom . ke val p ate l 2 1 0 6 . y ip . repo . deadline Repo . Deadline Repo Ċ import Ġcom . ke val p ate l 2 1 0 6 . y ip . utils . App Shortcut Helper Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . wh enever Ċ import Ġio . reactivex . Back pressure Strategy Ċ import Ġio . reactivex . Single Ċ import Ġio . reactivex . subjects . Behavior Subject Ċ import Ġio . reactivex . subjects . Publish Subject Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . mockito . Argument Matchers . any Float Ċ import Ġorg . mockito . Argument Matchers . any Int Ċ import Ġorg . mockito . Argument Matchers . any List Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito Annotations Ċ Ċ abstract Ġclass ĠDashboard ViewModel Test SetUp Ġ{ ĊĠĠĠ Ġprotected Ġval Ġdeadline Monitor ErrorMessage Ġ= Ġ" test Ġerror " ĊĠĠĠ Ġprotected Ġval Ġdeadline NotFound Message Ġ= Ġ" test Ġerror Ġ 1 " ĊĠĠĠ Ġprotected Ġval Ġno Items Message Ġ= Ġ" no Items " ĊĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġ@ Rule ĊĠĠĠ Ġval Ġrule Ġ= ĠInstant Task Executor Rule () ĊĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġ@ Rule ĊĠĠĠ Ġval Ġrule 1 Ġ= ĠRx Schedulers Override Rule () ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġapplication : ĠApplication ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġresources : ĠResources ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġdeadline Repo : ĠDead line Repo ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġbilling Repo : ĠBilling Repo ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġapp Shortcut Helper : ĠApp Shortcut Helper ĊĊĠĠĠ Ġprotected Ġval Ġk Fixture : ĠK Fixture Ġ= ĠK Fixture Ġ{ Ġadd ( Ignore Default ArgsConstructor Custom isation ()) Ġ} ĊĠĠĠ Ġprotected Ġval Ġdeadline List Subject Ġ= ĠPublish Subject . create < List < Deadline >>() ĊĠĠĠ Ġprotected Ġval Ġis Purchase d Subject Ġ= ĠBehavior Subject . create < Boolean >() ĊĊĠĠĠ Ġinternal Ġlateinit Ġvar Ġmodel : ĠDashboard ViewModel ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġbefore () Ġ{ ĊĠĠĠĠĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠĠĠĠĠĠĠ Ġwhenever ( deadline Repo . observe All Dead lines ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( deadline List Subject . hide (). to Flow able ( Back pressure Strategy . DROP )) ĊĠĠĠĠĠĠĠ Ġwhenever ( billing Repo . observe Is Purchase d ()). thenReturn ( is Purchase d Subject ) ĊĠĠĠĠĠĠĠ Ġwhenever ( app Shortcut Helper . update Dynamic Shortcut s ( any List ())). thenReturn ( true ) ĊĊĠĠĠĠĠĠĠ Ġwhenever ( resources . get Dimension ( any Int ())). thenReturn ( 2 f ) ĊĠĠĠĠĠĠĠ Ġwhenever ( application . resources ). thenReturn ( resources ) ĊĠĠĠĠĠĠĠ Ġwhenever ( application . getString ( any Int (), Ġany Float ())). thenReturn (" 5 5 % ") ĊĊĠĠĠĠĠĠĠ Ġwhenever ( application . getString ( R . string . dashboard _ no _ deadline _ message )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( no Items Message ) ĊĠĠĠĠĠĠĠ Ġwhenever ( application . getString ( R . string . dashboard _ error _ loading _ deadline )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( deadline Monitor ErrorMessage ) ĊĠĠĠĠĠĠĠ Ġwhenever ( application . getString ( R . string . error _ deadline _ not _ exist )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( deadline NotFound Message ) ĊĊĠĠĠĠĠĠĠ Ġmodel Ġ= ĠDashboard ViewModel ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapplication , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdeadline Repo , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbilling Repo , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapp Shortcut Helper ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected Ġfun Ġset As Deadline Detail Expanded ( test Expanded Deadline : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( deadline Repo . is Deadline Exist ( test Expanded Deadline )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( Single . just ( true )) ĊĠĠĠĠĠĠĠ Ġmodel . on Open Deadline Detail ( test Expanded Deadline , Ġ 0 ) ĊĠĠĠ Ġ} Ċ } Ċ