package Ġcom . tech . weather forecast . local Ċ Ċ import Ġcom . tech . weather forecast . common _ test . datasets . Weather Dataset Ċ import Ġcom . tech . weather forecast . common _ test . datasets . Weather Dataset . DATE _ REFRESH Ċ import Ġcom . tech . weather forecast . common _ test . extensions . blocking Ob serve Ċ import Ġcom . tech . weather forecast . model . Weather Forecast Ċ import Ġcom . tech . weather forecast . local . base . Base Test Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Assert . assertNot Equals Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠWeather Forecast Dao Test : ĠBaseTest () Ġ{ ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġoverride Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . setUp () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Throws ( Exception :: class ) ĊĠĠĠ Ġfun Ġwrite Weather And Read () Ġ{ ĊĠĠĠĠĠĠĠ Ġdatabase . weather Dao (). save ( Weather Dataset . FA KE _ WE ATHER [ 0 ]) ĊĊĠĠĠĠĠĠĠ Ġval Ġweather Ġ= Ġdatabase . weather Dao (). get Weather Forecast ( 1 ). blocking Ob serve () ĊĠĠĠĠĠĠĠ Ġcompare Two Weather ( Weather Dataset . FA KE _ WE ATHER . first (), Ġweather !! ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsave Weather _ Date Must Change () Ġ{ ĊĠĠĠĠĠĠĠ Ġdatabase . weather Dao (). save ( Weather Dataset . FA KE _ WE ATHER [ 0 ]) ĊĠĠĠĠĠĠĠ Ġval Ġweather Ġ= Ġdatabase . weather Dao (). get Weather Forecast ( 1 ). blocking Ob serve () ĊĠĠĠĠĠĠĠ Ġassert Not Equals ( DATE _ REFRESH , Ġweather !!. last Ref reshed ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Ġ--- ĊĊĠĠĠ Ġprivate Ġfun Ġcompare Two Weather ( weather : ĠWeather Forecast , Ġweather Test : ĠWeather Forecast ){ ĊĠĠĠĠĠĠĠ ĠassertEquals ( weather . name , Ġweather Test . name ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( weather . description , Ġweather Test . description ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( weather . temperature , Ġweather Test . temperature , Ġ 0 . 0 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( weather . temperature Max , Ġweather Test . temperature Max , Ġ 0 . 0 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( weather . temperature Min , Ġweather Test . temperature Min , Ġ 0 . 0 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( weather . last Ref reshed , Ġweather Test . last Ref reshed ) ĊĠĠĠ Ġ} Ċ }