package Ġcom . sky do ves . github follow s . persistence . db Ċ Ċ import Ġandroid . support . test . runner . Android JUnit 4 Ċ import Ġcom . sky do ves . github follow s . models . Github User Ċ import Ġcom . sky do ves . github follow s . utils . LiveData TestUtil Ċ import Ġcom . sky do ves . github follow s . utils . Mock TestUtil Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . hamcrest . Matchers .` is ` Ċ import Ġorg . hamcrest . Matchers . notNull Value Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġsky do ves Ġon Ġ 2 0 1 8 . Ġ 3 . Ġ 8 . Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 1 8 Ġsky do ves ĠAll Ġrights Ġreserved . Ċ Ġ*/ Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠGithub User Dao Test Ġ: ĠDB Test () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġgithub User : ĠGithub User ĊĠĠĠ Ġprivate Ġval Ġlogin Ġ= Ġ" sky do ves " ĊĊĠĠĠ Ġ@ Before Ġfun Ġinit Mock () Ġ{ ĊĠĠĠĠĠĠĠ Ġgithub User Ġ= ĠMock TestUtil . mock Github User () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġinsert Github U set Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġdb . github User Dao (). insert Github User ( github User ) ĊĊĠĠĠĠĠĠĠ Ġval Ġloaded Ġ= ĠLive Data TestUtil . getValue ( db . github User Dao (). get Github User ( login )) ĊĠĠĠĠĠĠĠ ĠassertThat ( loaded , Ġnot NullValue ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( loaded . login , Ġ` is `( login )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġtruncate Github User Table () Ġ{ ĊĠĠĠĠĠĠĠ Ġdb . github User Dao (). truncate Github User () ĊĊĠĠĠĠĠĠĠ Ġval Ġloaded Ġ= ĠLive Data TestUtil . getValue ( db . github User Dao (). get Github User ( login )) ĊĠĠĠĠĠĠĠ ĠAssert . assertNull ( loaded ) ĊĠĠĠ Ġ} Ċ } Ċ