package Ġcom . kick starter . libs . utils Ċ Ċ import Ġcom . kick starter . KS Ro bo lectric TestCase Ċ import Ġcom . kick starter . libs . Ref Tag Ċ import Ġcom . kick starter . libs . models . Optim iz ely Environment Ċ import Ġcom . kick starter . mock . factories . User Factory Ċ import Ġorg . junit . Test Ċ Ċ class ĠExperiment UtilsTest Ġ: ĠK S Ro bo lectric TestCase () Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġattributes _ logged In User _ not Prod () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuser Ġ= ĠUser Factory . user () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. back ed Projects Count ( 1 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġval Ġexperiment Data Ġ= ĠExperiment Data ( user , ĠRef Tag . discovery (), ĠRef Tag . search ()) ĊĠĠĠĠĠĠĠ Ġval Ġattributes Ġ= ĠExperiment Utils . attributes ( experiment Data , Ġ" 9 . 9 . 9 ", Ġ" 1 0 ", ĠOptim iz ely Environment . DE VELO P MENT ) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( attributes [" distinct _ id "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 9 . 9 . 9 ", Ġattributes [" session _ app _ release _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Android Ġ 1 0 ", Ġattributes [" session _ os _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" discovery ", Ġattributes [" session _ ref _ tag "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" search ", Ġattributes [" session _ referrer _ credit "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( true , Ġattributes [" session _ user _ is _ logged _ in "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 0 , Ġattributes [" user _ back ed _ projects _ count "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" US ", Ġattributes [" user _ country "]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġattributes _ logged In User _ prod () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuser Ġ= ĠUser Factory . user () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. back ed Projects Count ( 1 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġval Ġexperiment Data Ġ= ĠExperiment Data ( user , ĠRef Tag . discovery (), ĠRef Tag . search ()) ĊĠĠĠĠĠĠĠ Ġval Ġattributes Ġ= ĠExperiment Utils . attributes ( experiment Data , Ġ" 9 . 9 . 9 ", Ġ" 1 0 ", ĠOptim iz ely Environment . PRO DU CTION ) ĊĠĠĠĠĠĠĠ ĠassertNull ( attributes [" distinct _ id "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 9 . 9 . 9 ", Ġattributes [" session _ app _ release _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Android Ġ 1 0 ", Ġattributes [" session _ os _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" discovery ", Ġattributes [" session _ ref _ tag "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" search ", Ġattributes [" session _ referrer _ credit "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( true , Ġattributes [" session _ user _ is _ logged _ in "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 0 , Ġattributes [" user _ back ed _ projects _ count "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" US ", Ġattributes [" user _ country "]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġattributes _ logged Out User _ not Prod () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexperiment Data Ġ= ĠExperiment Data ( null , ĠRef Tag . discovery (), ĠRef Tag . search ()) ĊĠĠĠĠĠĠĠ Ġval Ġattributes Ġ= ĠExperiment Utils . attributes ( experiment Data , Ġ" 9 . 9 . 9 ", Ġ" 9 ", ĠOptim iz ely Environment . DE VELO P MENT ) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( attributes [" distinct _ id "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 9 . 9 . 9 ", Ġattributes [" session _ app _ release _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Android Ġ 9 ", Ġattributes [" session _ os _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" discovery ", Ġattributes [" session _ ref _ tag "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" search ", Ġattributes [" session _ referrer _ credit "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( false , Ġattributes [" session _ user _ is _ logged _ in "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 0 , Ġattributes [" user _ back ed _ projects _ count "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" US ", Ġattributes [" user _ country "]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġattributes _ logged Out User _ prod () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexperiment Data Ġ= ĠExperiment Data ( null , ĠRef Tag . discovery (), ĠRef Tag . search ()) ĊĠĠĠĠĠĠĠ Ġval Ġattributes Ġ= ĠExperiment Utils . attributes ( experiment Data , Ġ" 9 . 9 . 9 ", Ġ" 9 ", ĠOptim iz ely Environment . PRO DU CTION ) ĊĠĠĠĠĠĠĠ ĠassertNull ( attributes [" distinct _ id "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 9 . 9 . 9 ", Ġattributes [" session _ app _ release _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Android Ġ 9 ", Ġattributes [" session _ os _ version "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" discovery ", Ġattributes [" session _ ref _ tag "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" search ", Ġattributes [" session _ referrer _ credit "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( false , Ġattributes [" session _ user _ is _ logged _ in "]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 0 , Ġattributes [" user _ back ed _ projects _ count "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" US ", Ġattributes [" user _ country "]) ĊĠĠĠ Ġ} Ċ } Ċ