/* Ċ Ġ* ĠDesign ed Ġand Ġdeveloped Ġby Ġ 2 0 2 0 Ġsky do ves Ġ( Ja ew o ong ĠE um ) Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġcom . sky do ves . dis ney mot ions . repository Ċ Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . at Least Once Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . mock Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . verify Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . wh enever Ċ import Ġcom . sky do ves . dis ney mot ions . persistence . Post er Dao Ċ import Ġcom . sky do ves . dis ney mot ions . utils . Mock TestUtil . mock Post er Ċ import Ġkotlinx . coroutines . flow . collect Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . hamcrest . core . Is .` is ` Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠDetail Repository Test Ġ{ ĊĊĠ Ġprivate Ġlateinit Ġvar Ġrepository : ĠDetail Repository ĊĠ Ġprivate Ġval Ġposter Dao : ĠPost er Dao Ġ= Ġmock () ĊĊĠ Ġ@ Before ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ Ġrepository Ġ= ĠDetail Repository ( poster Dao ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġget Post er ById Test () Ġ= Ġrun Blocking < Unit > Ġ{ ĊĠĠĠ Ġval Ġmock Data Ġ= Ġmock Post er () ĊĠĠĠ Ġwhenever ( poster Dao . getPost er ( 0 )). thenReturn ( mock Data ) ĊĊĠĠĠ Ġrepository . getPost er ById ( 0 ) ĊĠĠĠĠĠ Ġ. collect Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( it . id , Ġ` is `( 0 L )) ĊĠĠĠĠĠĠĠ ĠassertThat ( it . name , Ġ` is ` (" Frozen ĠII ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( it . release , Ġ` is ` (" 2 0 1 9 ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( it , Ġ` is `( mock Data )) ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġverify ( poster Dao , Ġat Least Once ()). getPost er ( 0 ) ĊĠ Ġ} Ċ } Ċ