package Ġcom . ep ite ch . di abet ips Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . appcompat . app . AppCompat Delegate Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġandroidx . test . platform . app . Instrumentation Registry Ċ import Ġcom . ep ite ch . di abet ips . adapters .* Ċ import Ġcom . ep ite ch . di abet ips . managers . User Manager Ċ import Ġcom . ep ite ch . di abet ips . managers . Auth Manager Ċ import Ġcom . ep ite ch . di abet ips . managers . Mode Manager Ċ import Ġcom . ep ite ch . di abet ips . storage s .* Ċ import Ġcom . ep ite ch . di abet ips . utils . Time Handler Ċ import Ġorg . junit . Assert .* Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . Before Ċ Ċ /** Ċ Ġ* ĠInstrument ed Ġtest , Ġwhich Ġwill Ġexecute Ġon Ġan ĠAndroid Ġdevice . Ċ Ġ* Ċ Ġ* ĠSee Ġ[ testing Ġdocumentation ]( http :// d . android . com / tools / testing ). Ċ Ġ*/ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠInstrument ed UnitTest Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġinstrument ation Context : ĠContext ĊĊĠĠĠ Ġprivate Ġvar Ġtime Format : ĠString Ġ= Ġ"" ĊĠĠĠ Ġprivate Ġvar ĠcurrentTime : ĠString Ġ= Ġ"" ĊĠĠĠ Ġprivate Ġvar Ġcurrent Timestamp : ĠLong Ġ= Ġ 0 ĊĠĠĠ Ġprivate Ġval Ġfood Array Ġ= ĠarrayOf ( Food Object ( 1 , Ġ" Food "), ĠFood Object ( 2 ), ĠFood Object ( 3 )) ĊĠĠĠ Ġprivate Ġval Ġingredient Array Ġ= ĠarrayOf ( Ingredient Object ( 5 f , Ġfood Ġ= ĠFood Object ( 1 , Ġ" Food ")), ĠIng redient Object ( 1 f , Ġfood Ġ= ĠFood Object ( 2 , Ġ" Ingredient ")), ĠIng redient Object ( 8 f , Ġfood Ġ= ĠFood Object ( 3 ))) ĊĠĠĠ Ġprivate Ġval Ġrecipe Array Ġ= ĠarrayOf ( Recipe Object ( 1 , Ġ" Recipe "), ĠRecipe Object ( 2 ), ĠRecipe Object ( 3 )) ĊĠĠĠ Ġprivate Ġval Ġme al Recipe Array Ġ= ĠarrayOf ( Me al Recipe Object ( 0 f , Ġrecipe Ġ= ĠRecipe Object ( 1 , Ġ" Recipe ")), ĠMe al Recipe Object ( 0 f , Ġrecipe Ġ= ĠRecipe Object ( 2 )), ĠMe al Recipe Object ( 0 f , Ġrecipe Ġ= ĠRecipe Object ( 3 ))) ĊĠĠĠ Ġprivate Ġval Ġme al Array Ġ= ĠarrayOf ( Me al Object ( 1 , Ġ"", Ġ" Me al "), ĠMe al Object ( 2 ), ĠMe al Object ( 3 )) ĊĠĠĠ Ġprivate Ġval Ġh ba 1 c Array Ġ= ĠarrayOf ( Hb A 1 c Object ( 1 , Ġ 5 . 5 f ), ĠH b A 1 c Object ( 2 , Ġ 1 0 f ), ĠH b A 1 c Object ( 3 , Ġ 7 f )) ĊĠĠĠ Ġprivate Ġval Ġchat Array Ġ= ĠarrayOf ( Chat Object (" 1 ", Ġcontent Ġ= Ġ" Message Ġ 1 "), ĠChat Object (" 2 ", Ġcontent Ġ= Ġ" Message Ġ 2 "), ĠChat Object (" 3 ", Ġcontent Ġ= Ġ" Message Ġ 3 ")) ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ Ġinstrument ation Context Ġ= ĠInstrument ation Registry . get Instrumentation (). target Context ĊĠĠĠĠĠĠĠ Ġtime Format Ġ= Ġinstrument ation Context . getString ( R . string . format _ time _ api ) ĊĠĠĠĠĠĠĠ Ġcurrent Timestamp Ġ= ĠTime Handler . instance . currentTime () ĊĠĠĠĠĠĠĠ ĠcurrentTime Ġ= ĠTime Handler . instance . format Timestamp ( current Timestamp , Ġtime Format ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsave AndGet AccessToken () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Token Ġ= Ġ" 4 9 fad 3 9 0 4 9 1 a 5 b 5 4 7 d 0 f 7 8 2 3 0 9 b 6 a 5 b 3 3 f 7 ac 0 8 7 " ĊĠĠĠĠĠĠĠ ĠAuth Manager . instance . save AccessToken ( instrumentation Context , Ġexpected Token ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Token Ġ= ĠAuth Manager . instance . get AccessToken ( instrumentation Context ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġaccess Ġtoken ", Ġexpected Token , Ġactual Token ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsave AndGet RefreshToken () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Token Ġ= Ġ" 8 x LO xB t Zp 8 " ĊĠĠĠĠĠĠĠ ĠAuth Manager . instance . save RefreshToken ( instrumentation Context , Ġexpected Token ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Token Ġ= ĠAuth Manager . instance . get RefreshToken ( instrumentation Context ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġrefresh Ġtoken ", Ġexpected Token , Ġactual Token ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsave AndGet Dark Mode () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Mode Ġ= Ġ ĠAppCompat Delegate . MODE _ N IGHT _ YES ĊĠĠĠĠĠĠĠ ĠMode Manager . instance . save Dark Mode ( instrumentation Context , Ġexpected Mode ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Mode Ġ= Ġ ĠMode Manager . instance . get Dark Mode ( instrumentation Context ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġdark Ġmode ", Ġexpected Mode , Ġactual Mode ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsave AndGet Account () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Account Ġ= ĠUser Object (" nom . pre nom @ email . com ", Ġ" password ", Ġ" NO M ", Ġ" Pr Ã© nom ") ĊĠĠĠĠĠĠĠ ĠUser Manager . instance . save User ( instrumentation Context , Ġexpected Account ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Account Ġ= Ġ ĠUser Manager . instance . getUser ( instrumentation Context ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġaccount ", Ġexpected Account , Ġactual Account ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġremove Account () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Account Ġ= ĠUser Object (" nom . pre nom @ email . com ", Ġ" password ", Ġ" NO M ", Ġ" Pr Ã© nom ") ĊĠĠĠĠĠĠĠ ĠUser Manager . instance . save User ( instrumentation Context , Ġexpected Account ) ĊĠĠĠĠĠĠĠ ĠUser Manager . instance . remove User ( instrumentation Context ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Account Ġ= Ġ ĠUser Manager . instance . getUser ( instrumentation Context ) ĊĠĠĠĠĠĠĠ Ġassert Not Equals (" Wrong Ġaccount ", Ġexpected Account , Ġactual Account ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsave AndGet Bio metric () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Bio metric Ġ= ĠBio metric Object ( 8 0 , Ġ 1 7 5 , Ġ 6 0 , Ġ 1 8 0 , Ġ" 2 0 2 0 - 1 0 - 0 5 ", Ġ" male ") ĊĠĠĠĠĠĠĠ ĠUser Manager . instance . save Bio metric ( instrumentation Context , Ġexpected Bio metric ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Bio metric Ġ= Ġ ĠUser Manager . instance . get Bio metric ( instrumentation Context ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġaccount ", Ġexpected Bio metric , Ġactual Bio metric ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġremove Bio metric () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Bio metric Ġ= ĠBio metric Object ( 8 0 , Ġ 1 7 5 , Ġ 6 0 , Ġ 1 8 0 , Ġ" 2 0 2 0 - 1 0 - 0 5 ", Ġ" male ") ĊĠĠĠĠĠĠĠ ĠUser Manager . instance . save Bio metric ( instrumentation Context , Ġexpected Bio metric ) ĊĠĠĠĠĠĠĠ ĠUser Manager . instance . remove Bio metric ( instrumentation Context ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Bio metric Ġ= Ġ ĠUser Manager . instance . get Bio metric ( instrumentation Context ) ĊĠĠĠĠĠĠĠ Ġassert Not Equals (" Wrong Ġaccount ", Ġexpected Bio metric , Ġactual Bio metric ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfood Adapter Set Food s () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfood Adapter Ġ= ĠFood Adapter () ĊĠĠĠĠĠĠĠ Ġfood Adapter . set Food s ( food Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠFood ĠAdapter ĠSet ĠFood s ", Ġfood Array . size , Ġfood Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfood Adapter Add Food s () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfood Adapter Ġ= ĠFood Adapter () ĊĠĠĠĠĠĠĠ Ġfood Adapter . add Food s ( food Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠFood ĠAdapter ĠAdd ĠFood s ", Ġfood Array . size , Ġfood Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġrecipe Adapter Set Recipes () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrecipe Adapter Ġ= ĠRecipe Adapter () ĊĠĠĠĠĠĠĠ Ġrecipe Adapter . set Recipes ( recipe Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠRecipe ĠAdapter ĠSet ĠRe cipes ", Ġrecipe Array . size , Ġrecipe Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġrecipe Adapter Add Recipe () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrecipe Adapter Ġ= ĠRecipe Adapter () ĊĠĠĠĠĠĠĠ Ġrecipe Adapter . add Recipe ( recipe Array [ 0 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠRecipe ĠAdapter ĠAdd ĠRecipe ", 1 , Ġrecipe Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġrecipe Adapter Add Recipes () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrecipe Adapter Ġ= ĠRecipe Adapter () ĊĠĠĠĠĠĠĠ Ġrecipe Adapter . add Recipes ( recipe Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠRecipe ĠAdapter ĠAdd ĠRe cipes ", Ġrecipe Array . size , Ġrecipe Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġrecipe Food Adapter Set Food s () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrecipe Food Adapter Ġ= ĠRecipe Food Adapter () ĊĠĠĠĠĠĠĠ Ġrecipe Food Adapter . set Food s ( ingredient Array ) ĊĠĠĠĠĠĠĠ Ġassert ArrayEquals (" Wrong ĠRecipe ĠFood ĠAdapter ĠSet ĠFood s ", Ġingredient Array , Ġrecipe Food Adapter . get Food s (). to Typed Array ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġrecipe Food Adapter Add Food () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrecipe Food Adapter Ġ= ĠRecipe Food Adapter () ĊĠĠĠĠĠĠĠ Ġrecipe Food Adapter . add Food ( ingredient Array [ 0 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠRecipe ĠFood ĠAdapter ĠAdd ĠFood ", Ġingredient Array [ 0 ], Ġrecipe Food Adapter . get Food s ()[ 0 ]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġme al Recipe Adapter Set Recipes () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġme al Recipe Adapter Ġ= ĠMe al Recipe Adapter () ĊĠĠĠĠĠĠĠ Ġme al Recipe Adapter . set Recipes ( meal Recipe Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠMe al ĠRecipe ĠAdapter ĠSet ĠRe cipes ", Ġme al Recipe Array . size , Ġme al Recipe Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġme al Recipe Adapter Add Recipe () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġme al Recipe Adapter Ġ= ĠMe al Recipe Adapter () ĊĠĠĠĠĠĠĠ Ġme al Recipe Adapter . add Recipe ( meal Recipe Array [ 0 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠMe al ĠRecipe ĠAdapter ĠAdd ĠRecipe ", Ġme al Recipe Array [ 0 ], Ġme al Recipe Adapter . get Recipes ()[ 0 ]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġh ba 1 c Adapter Set Hb A 1 c () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhb A 1 c Adapter Ġ= ĠH b A 1 c Adapter () ĊĠĠĠĠĠĠĠ Ġhb A 1 c Adapter . set Hb A 1 c ( h ba 1 c Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠH b A 1 c ĠAdapter ĠSet ĠH b A 1 c ", Ġh ba 1 c Array . size , Ġhb A 1 c Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġh ba 1 c Adapter Add Hb A 1 c () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhb A 1 c Adapter Ġ= ĠH b A 1 c Adapter () ĊĠĠĠĠĠĠĠ Ġhb A 1 c Adapter . add Hb A 1 c ( h ba 1 c Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠH b A 1 c ĠAdapter ĠAdd ĠH b A 1 c ", Ġh ba 1 c Array . size , Ġhb A 1 c Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġchat Adapter Set Messages () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġchat Adapter Ġ= ĠChat Adapter () ĊĠĠĠĠĠĠĠ Ġchat Adapter . set Messages ( chat Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠChat ĠAdapter ĠSet ĠMessages ", Ġchat Array . size , Ġchat Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġchat Adapter Add Message () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġchat Adapter Ġ= ĠChat Adapter () ĊĠĠĠĠĠĠĠ Ġchat Adapter . addMessage ( chat Array [ 0 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠChat ĠAdapter ĠAdd ĠMessage ", Ġ 1 , Ġchat Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġchat Adapter Add Messages () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġchat Adapter Ġ= ĠChat Adapter () ĊĠĠĠĠĠĠĠ Ġchat Adapter . add Messages ( chat Array ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠChat ĠAdapter ĠAdd ĠMessages ", Ġchat Array . size , Ġchat Adapter . item Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġbio metric Object Sex () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbio metric Ġ= ĠBio metric Object ( 8 0 , Ġ 1 7 5 , Ġ 6 0 , Ġ 1 8 0 , Ġ" 2 0 2 0 - 1 0 - 0 5 ") ĊĠĠĠĠĠĠĠ Ġbio metric . set Sex ( instrumentation Context , Ġinstrument ation Context . resources . getString Array ( R . array . sex )[ 0 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġsex ", Ġinstrument ation Context . resources . getString Array ( R . array . sex )[ 0 ], Ġbio metric . getS ex ( instrumentation Context )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġbio metric Object Di abet es Type () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbio metric Ġ= ĠBio metric Object ( 8 0 , Ġ 1 7 5 , Ġ 6 0 , Ġ 1 8 0 , Ġ" 2 0 2 0 - 1 0 - 0 5 ") ĊĠĠĠĠĠĠĠ Ġbio metric . set Di abet es Type ( instrumentation Context , Ġinstrument ation Context . resources . getString Array ( R . array . di abet es _ type )[ 0 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġdi abet es Ġtype ", Ġinstrument ation Context . resources . getString Array ( R . array . di abet es _ type )[ 0 ], Ġbio metric . get Di abet es Type ( instrumentation Context )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġactivity Start () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġactivity Ġ= ĠActivity Object ( start Ġ= ĠcurrentTime , Ġend Ġ= ĠcurrentTime ) ĊĠĠĠĠĠĠĠ Ġactivity . set Start ( instrumentation Context , ĠcurrentTime ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġactivity Ġstart ", Ġactivity . start , ĠcurrentTime ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġactivity Duration () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġactivity Ġ= ĠActivity Object ( start Ġ= ĠcurrentTime , Ġend Ġ= ĠcurrentTime ) ĊĠĠĠĠĠĠĠ Ġactivity . set Duration ( instrumentation Context , ĠTime Handler . instance . format Timestamp ( Time Handler . instance . add TimeTo Timestamp ( 0 , Ġ 9 0 ), Ġtime Format , Ġtrue )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġactivity Ġend ", Ġactivity . end , ĠTime Handler . instance . add TimeTo Format ( currentTime , Ġtime Format , Ġ 9 0 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġactivity Duration Second () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġactivity Ġ= ĠActivity Object ( start Ġ= ĠcurrentTime , Ġend Ġ= ĠcurrentTime ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong Ġactivity Ġduration ", Ġactivity . get Duration Second ( instrumentation Context ), Ġ 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtime Handler Timestamp To Time () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠTimestamp Ġto ĠTime ", ĠcurrentTime , ĠTime Handler . instance . format Timestamp ( current Timestamp , Ġtime Format )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtime Handler TimeTo Timestamp () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠTime Ġto ĠTimestamp ", Ġcurrent Timestamp , ĠTime Handler . instance . getTimestamp From Format ( currentTime , Ġtime Format )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtime Handler Add Time () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠAdd ĠTime ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . add TimeTo Timestamp ( current Timestamp , Ġ 9 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . getTimestamp From Format ( Time Handler . instance . add TimeTo Format ( currentTime , Ġtime Format , Ġ 9 0 ), Ġtime Format )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtime Handler Change Date () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠChange ĠDate ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . change Timestamp Date ( current Timestamp , Ġ 2 0 0 0 , Ġ 9 , Ġ 1 2 ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . getTimestamp From Format ( Time Handler . instance . change Format Date ( currentTime , Ġtime Format , Ġ 2 0 0 0 , Ġ 9 , Ġ 1 2 ), Ġtime Format )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtime Handler Change Time () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠChange ĠTime ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . change Timestamp Time ( current Timestamp , Ġ 1 2 , Ġ 3 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . getTimestamp From Format ( Time Handler . instance . change Format Time ( currentTime , Ġtime Format , Ġ 1 2 , Ġ 3 0 ), Ġtime Format )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtime Handler Second Diff () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" Wrong ĠSecond ĠDiff ", ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . get Second Diff Format ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . change Format Time ( currentTime , Ġtime Format , Ġ 1 2 , Ġ 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . change Format Time ( currentTime , Ġtime Format , Ġ 1 4 , Ġ 3 0 ), Ġtime Format ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . get Second Diff ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . change Timestamp Time ( current Timestamp , Ġ 1 2 , Ġ 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTime Handler . instance . change Timestamp Time ( current Timestamp , Ġ 1 4 , Ġ 3 0 ))) ĊĠĠĠ Ġ} Ċ } Ċ