package Ġcom . blink ist . easy library . data . map pers Ċ Ċ import Ġcom . blink ist . easy library . database . models . Local Book Ċ import Ġcom . blink ist . easy library . network . models . Remote Book Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . th reet en . bp . LocalDate Ċ Ċ class ĠBook Mapper Test Ġ{ ĊĊĠ Ġprivate Ġlateinit Ġvar Ġbook Mapper : ĠBook Mapper ĊĊĠ Ġ@ Before Ġfun Ġsetup () Ġ{ ĊĠĠĠ Ġbook Mapper Ġ= ĠBook Mapper () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` test Ġremote Ġto Ġlocal Ġmapping `() Ġ{ ĊĠĠĠ Ġval Ġremote Book Ġ= ĠRemote Book ( ĊĠĠĠĠĠ Ġid Ġ= Ġ 1 0 , ĊĠĠĠĠĠ Ġpublished Date Ġ= ĠLocalDate . parse (" 2 0 1 0 - 1 0 - 1 0 "), ĊĠĠĠĠĠ Ġtitle Ġ= Ġ" title ", ĊĠĠĠĠĠ Ġauthors Ġ= Ġ" authors ", ĊĠĠĠĠĠ Ġthumbnail Ġ= Ġ" thumbnail ", ĊĠĠĠĠĠ Ġurl Ġ= Ġ" url " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġlocal Book Ġ= Ġbook Mapper . remote ToLocal ( listOf ( remote Book )). first () ĊĊĠĠĠ ĠassertThat ( local Book . id ). isEqualTo ( remote Book . id ) ĊĠĠĠ ĠassertThat ( local Book . published Date ). isEqualTo ( remote Book . published Date ) ĊĠĠĠ ĠassertThat ( local Book . title ). isEqualTo ( remote Book . title ) ĊĠĠĠ ĠassertThat ( local Book . authors ). isEqualTo ( remote Book . authors ) ĊĠĠĠ ĠassertThat ( local Book . thumbnail ). isEqualTo ( remote Book . thumbnail ) ĊĠĠĠ ĠassertThat ( local Book . url ). isEqualTo ( remote Book . url ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġ` test Ġlocal Ġto Ġpresentation Ġmapping `() Ġ{ ĊĠĠĠ Ġval Ġlocal Book Ġ= ĠLocal Book ( ĊĠĠĠĠĠ Ġid Ġ= Ġ 1 0 , ĊĠĠĠĠĠ Ġpublished Date Ġ= ĠLocalDate . parse (" 2 0 1 0 - 1 0 - 1 0 "), ĊĠĠĠĠĠ Ġtitle Ġ= Ġ" title ", ĊĠĠĠĠĠ Ġauthors Ġ= Ġ" authors ", ĊĠĠĠĠĠ Ġthumbnail Ġ= Ġ" thumbnail ", ĊĠĠĠĠĠ Ġurl Ġ= Ġ" url " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġbook Ġ= Ġbook Mapper . local To Presentation ( listOf ( local Book )). first () ĊĊĠĠĠ ĠassertThat ( book . id ). isEqualTo ( local Book . id ) ĊĠĠĠ ĠassertThat ( book . published Date ). isEqualTo ( local Book . published Date ) ĊĠĠĠ ĠassertThat ( book . title ). isEqualTo ( local Book . title ) ĊĠĠĠ ĠassertThat ( book . authors ). isEqualTo ( local Book . authors ) ĊĠĠĠ ĠassertThat ( book . imageUrl ). isEqualTo ( local Book . thumbnail ) ĊĠĠĠ ĠassertThat ( book . url ). isEqualTo ( local Book . url ) ĊĠ Ġ} Ċ } Ċ