/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 6 ĠAlex ey ĠV ere in Ċ Ġ* Ċ Ġ* Ġ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 . ant onio le iva . band hook kotlin . ui . entity . mapper Ċ Ċ import Ġcom . ant onio le iva . band hook kotlin . domain . entity . Album Ċ import Ġcom . ant onio le iva . band hook kotlin . domain . entity . Artist Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Assert . assertNull Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠImage Title Data Mapper Test Ġ{ ĊĊĠĠĠ Ġlateinit Ġvar Ġartists : ĠList < Artist > ĊĠĠĠ Ġlateinit Ġvar Ġalbum s : ĠList < Album > ĊĊĠĠĠ Ġlateinit Ġvar Ġimage Title Data Mapper : ĠImage Title Data Mapper ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġartist With ImageUrl Ġ= ĠArtist (" artist Ġid ", Ġ" artist Ġname ", Ġ" artist Ġurl ") ĊĠĠĠĠĠĠĠ Ġval Ġartist Without ImageUrl Ġ= ĠArtist (" artist Ġid ", Ġ" artist Ġname ") ĊĠĠĠĠĠĠĠ Ġval Ġartist With Empty ImageUrl Ġ= ĠArtist (" artist Ġid ", Ġ" artist Ġname ", Ġ"") ĊĊĠĠĠĠĠĠĠ Ġartists Ġ= ĠlistOf ( artist With ImageUrl , Ġartist Without ImageUrl , Ġartist With Empty ImageUrl ) ĊĊĠĠĠĠĠĠĠ Ġval Ġalbum With ImageUrl Ġ= ĠAlbum (" album Ġid ", Ġ" album Ġname ", Ġartist With ImageUrl , Ġ" album Ġurl ", Ġempty List ()) ĊĠĠĠĠĠĠĠ Ġval Ġalbum Without ImageUrl Ġ= ĠAlbum (" album Ġid ", Ġ" album Ġname ", Ġartist With ImageUrl , Ġnull , Ġempty List ()) ĊĠĠĠĠĠĠĠ Ġval Ġalbum With Empty ImageUrl Ġ= ĠAlbum (" album Ġid ", Ġ" album Ġname ", Ġartist With ImageUrl , Ġ"", Ġempty List ()) ĊĊĠĠĠĠĠĠĠ Ġalbum s Ġ= ĠlistOf ( album With ImageUrl , Ġalbum Without ImageUrl , Ġalbum With Empty ImageUrl ) ĊĊĠĠĠĠĠĠĠ Ġimage Title Data Mapper Ġ= ĠImage Title Data Mapper () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Transform Art ists () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġval Ġimage Titles Ġ= Ġimage Title Data Mapper . transform Art ists ( artists ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 0 ]. id , Ġimage Titles [ 0 ]. id ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 0 ]. name , Ġimage Titles [ 0 ]. name ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 0 ]. url , Ġimage Titles [ 0 ]. url ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 1 ]. id , Ġimage Titles [ 1 ]. id ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 1 ]. name , Ġimage Titles [ 1 ]. name ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 1 ]. url , Ġimage Titles [ 1 ]. url ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 2 ]. id , Ġimage Titles [ 2 ]. id ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( artists [ 2 ]. name , Ġimage Titles [ 2 ]. name ) ĊĠĠĠĠĠĠĠ ĠassertNull ( image Titles [ 2 ]. url ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Transform Album s () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġval Ġimage Titles Ġ= Ġimage Title Data Mapper . transform Album s ( albums ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 0 ]. id , Ġimage Titles [ 0 ]. id ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 0 ]. name , Ġimage Titles [ 0 ]. name ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 0 ]. url , Ġimage Titles [ 0 ]. url ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 1 ]. id , Ġimage Titles [ 1 ]. id ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 1 ]. name , Ġimage Titles [ 1 ]. name ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 1 ]. url , Ġimage Titles [ 1 ]. url ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 2 ]. id , Ġimage Titles [ 2 ]. id ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( albums [ 2 ]. name , Ġimage Titles [ 2 ]. name ) ĊĠĠĠĠĠĠĠ ĠassertNull ( image Titles [ 2 ]. url ) ĊĠĠĠ Ġ} Ċ }