package Ġcom . k rypt kode . farm z . app . data . db . far mer Ċ Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . k rypt kode . farm z . utils . Far mer Data Factory Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠFar mer Db Mapper Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġfar mer Db Mapper : ĠFar mer Db Mapper ĊĊĠĠĠ Ġprivate Ġval Ġfar mer Data Factory Ġ= ĠFar mer Data Factory () ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġfar mer Db Mapper Ġ= ĠFar mer Db Mapper Impl () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` map Db To Domain Ġmaps Ġall Ġfields Ġcorrectly `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdb Far mer Ġ= Ġfar mer Data Factory . create Mock Db Far mer () ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġfar mer Db Mapper . map Db To Domain ( db Far mer ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( result . id ). isEqualTo ( db Far mer . id ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . registration Number ). isEqualTo ( db Far mer . registration Number ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . b vn ). isEqualTo ( db Far mer . b vn ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . firstName ). isEqualTo ( db Far mer . firstName ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . middle Name ). isEqualTo ( db Far mer . middle Name ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . surname ). isEqualTo ( db Far mer . surname ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . date OfBirth ). isEqualTo ( db Far mer . date OfBirth ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . gender ). isEqualTo ( db Far mer . gender ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . national ity ). isEqualTo ( db Far mer . national ity ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . occup ation ). isEqualTo ( db Far mer . occup ation ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . mar ital Status ). isEqualTo ( db Far mer . mar ital Status ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . sp ouse Name ). isEqualTo ( db Far mer . sp ouse Name ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . address ). isEqualTo ( db Far mer . address ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . city ). isEqualTo ( db Far mer . city ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . l ga ). isEqualTo ( db Far mer . l ga ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . state ). isEqualTo ( db Far mer . state ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . mobile Number ). isEqualTo ( db Far mer . mobile Number ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . email Address ). isEqualTo ( db Far mer . email Address ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . id Type ). isEqualTo ( db Far mer . id Type ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . id Number ). isEqualTo ( db Far mer . id Number ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . issue Date ). isEqualTo ( db Far mer . issue Date ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . expiry Date ). isEqualTo ( db Far mer . expiry Date ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . id Image ). isEqualTo ( db Far mer . id Image ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . passport Photo ). isEqualTo ( db Far mer . passport Photo ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . fingerprint ). isEqualTo ( db Far mer . fingerprint ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` map Domain To Ġmaps Ġall Ġfields Ġcorrectly `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdomain Far mer Ġ= Ġfar mer Data Factory . create Mock Far mer () ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġfar mer Db Mapper . map Domain To Db ( domain Far mer ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( result . id ). isEqualTo ( domain Far mer . id ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . registration Number ). isEqualTo ( domain Far mer . registration Number ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . b vn ). isEqualTo ( domain Far mer . b vn ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . firstName ). isEqualTo ( domain Far mer . firstName ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . middle Name ). isEqualTo ( domain Far mer . middle Name ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . surname ). isEqualTo ( domain Far mer . surname ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . date OfBirth ). isEqualTo ( domain Far mer . date OfBirth ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . gender ). isEqualTo ( domain Far mer . gender ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . national ity ). isEqualTo ( domain Far mer . national ity ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . occup ation ). isEqualTo ( domain Far mer . occup ation ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . mar ital Status ). isEqualTo ( domain Far mer . mar ital Status ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . sp ouse Name ). isEqualTo ( domain Far mer . sp ouse Name ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . address ). isEqualTo ( domain Far mer . address ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . city ). isEqualTo ( domain Far mer . city ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . l ga ). isEqualTo ( domain Far mer . l ga ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . state ). isEqualTo ( domain Far mer . state ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . mobile Number ). isEqualTo ( domain Far mer . mobile Number ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . email Address ). isEqualTo ( domain Far mer . email Address ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . id Type ). isEqualTo ( domain Far mer . id Type ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . id Number ). isEqualTo ( domain Far mer . id Number ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . issue Date ). isEqualTo ( domain Far mer . issue Date ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . expiry Date ). isEqualTo ( domain Far mer . expiry Date ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . id Image ). isEqualTo ( domain Far mer . id Image ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . passport Photo ). isEqualTo ( domain Far mer . passport Photo ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . fingerprint ). isEqualTo ( domain Far mer . fingerprint ) ĊĠĠĠ Ġ} Ċ }