package Ġnet . rom . exchange . presentation . mapper Ċ Ċ import Ġnet . rom . exchange . domain . model . rom . Sea Ċ import Ġnet . rom . exchange . presentation . factory . Item Exchange Factory Ċ import Ġnet . rom . exchange . presentation . mapper . rom .* Ċ import Ġnet . rom . exchange . presentation . model . rom . Sea View Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . runners . JUnit 4 Ċ Ċ @ RunWith ( JUnit 4 :: class ) Ċ class ĠSe a Entity Mapper Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġsea View Mapper : ĠSe a View Mapper ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Item View Mapper Ġ= ĠData Item View Mapper () ĊĠĠĠĠĠĠĠ Ġsea View Mapper Ġ= ĠSe a View Mapper ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġall Mapper Ġ= ĠAll View Mapper ( data Item View Mapper ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġweek Mapper Ġ= ĠWeek View Mapper ( data Item View Mapper ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmonth Mapper Ġ= ĠMonth View Mapper ( data Item View Mapper ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġmap From Data Maps View () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠG IV EN ĊĠĠĠĠĠĠĠ Ġval Ġdomain Ġ= ĠItem Exchange Factory . make Sea () ĊĊĠĠĠĠĠĠĠ Ġ// ĠWHEN ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġsea View Mapper . map To View ( domain ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠTHEN ĊĠĠĠĠĠĠĠ Ġassert Data Equality ( view , Ġdomain ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġassert Data Equality ( view : ĠSe a View , Ġdomain : ĠSe a ) Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals ( domain . all . data . size , Ġview . all . data . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( domain . week . data . size , Ġview . week . data . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( domain . month . data . size , Ġview . month . data . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( domain . latest , Ġview . latest ) ĊĠĠĠ Ġ} Ċ }