/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 7 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . android . tools . adt ui . chart . h chart Ċ Ċ import Ġcom . android . tools . adt ui . model . Default H Node Ċ import Ġcom . android . tools . adt ui . model . Range Ċ import Ġcom . android . tools . adt ui . swing . Fake Keyboard Ċ import Ġcom . android . tools . adt ui . swing . Fake Ui Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ import Ġjava . awt .* Ċ Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . intellij . openapi . util . System Info . is Mac Ċ import Ġjava . awt . geom . Rectangle 2 D Ċ Ċ class ĠHT ree Chart Test Ġ{ ĊĠ Ġprivate Ġlateinit Ġvar Ġmy Ui : ĠFake Ui ĊĠ Ġprivate Ġlateinit Ġvar Ġmy Chart : ĠHT ree Chart < Default H Node < String >> ĊĠ Ġprivate Ġlateinit Ġvar Ġmy Range : ĠRange ĊĊĠ Ġ// ĠHeight Ġis Ġcal ulated Ġin Ġsetup . ĠIt Ġis Ġbased Ġoff Ġthe Ġfont Ġmetrics . ĠWith ĠJDK Ġ 1 1 Ġthe Ġfont Ġmetrics Ġreturn Ġslightly Ġdifferent Ġsizes Ġon Ġwindows ĊĠ Ġ// Ġvs Ġlinux Ġor Ġmac . ĊĠ Ġ// ĠThe Ġtotal Ġheight Ġis Ġthe Ġheight Ġof Ġthe Ġcontent Ġplus Ġthe Ġheight Ġof Ġthe Ġpadding . ĊĠ Ġprivate Ġvar Ġmy Total Height Ġ= Ġ 0 ĊĠ Ġprivate Ġval Ġmy View Height Ġ= Ġ 5 0 ĊĊĠ Ġ// ĠY Ġaxis ' Ġinitial Ġposition , Ġwhich Ġis Ġthe Ġnorth / south Ġboundary Ġof Ġa Ġtop - down / bottom - up Ġchart . ĊĠ Ġprivate Ġval Ġmy Initial Y Position Ġ= Ġ 0 ĊĊĠ Ġ@ Before ĊĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . BOTTOM _ UP ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun ĠsetUp ( orientation : ĠHT ree Chart . Orientation ) Ġ{ ĊĠĠĠ Ġmy Range Ġ= ĠRange ( 0 . 0 , Ġ 1 0 0 . 0 ) ĊĠĠĠ Ġval Ġtree Height Ġ= Ġ 4 ĊĠĠĠ Ġmy Chart Ġ= ĠHT ree Chart . Builder ( H Node Tree ( 0 , Ġtree Height , Ġ 2 ), Ġmy Range , ĠFake Renderer ()) ĊĠĠĠĠĠ Ġ. set Global X Range ( Range ( 0 . 0 , Ġ 1 0 0 . 0 )) ĊĠĠĠĠĠ Ġ. set Orientation ( orientation ) ĊĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġval Ġcontent Height Ġ= Ġ( my Chart . default Font Metrics . height Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠHT ree Chart . P ADDING ) Ġ* Ġ/* ĠDefault Ġpadding Ġ*/ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtree Height Ġ/* ĠHeight Ġof Ġtree Ġnode . Ġ*/ ĊĠĠĠ Ġmy Total Height Ġ= Ġcontent Height Ġ+ ĠHT ree Chart . HEIGHT _ P ADDING ĊĊĠĠĠ Ġmy Chart . size Ġ= ĠDimension ( 1 0 0 , Ġmy View Height ) ĊĠĠĠ Ġmy Ui Ġ= ĠFake Ui ( my Chart ) ĊĠĠĠ Ġmy Chart . y Range . set ( 1 0 . 0 , Ġ 1 0 . 0 ) ĊĠĠĠ Ġ// ĠSet Ġa Ġroot Ġpointing Ġto Ġa Ġtree Ġwith Ġmore Ġthan Ġone Ġnodes , Ġto Ġperform Ġsome Ġmeaningful Ġdr ags . ĊĠĠĠ ĠassertThat ( my Chart . maximum Height ). isEqualTo ( my Total Height ) ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠReturns Ġthe Ġroot Ġof Ġa Ġcomplete Ġtree Ġof ĠDefault H Node < String >. ĠThe Ġroot Ġis Ġat Ġthe Ġgiven Ġdepth , ĊĠĠ Ġ* Ġand Ġthe Ġsubtree Ġhas Ġthe Ġgiven Ġheight Ġand Ġbranch Ġfactor . ĊĠĠ Ġ*/ ĊĠ Ġprivate Ġfun ĠH Node Tree ( depth : ĠInt , Ġheight : ĠInt , Ġbranch : ĠInt ): ĠDefault H Node < String > Ġ{ ĊĠĠĠ Ġval Ġsub root Ġ= ĠDefault H Node ("") ĊĠĠĠ Ġsub root . depth Ġ= Ġdepth ĊĠĠĠ Ġif Ġ( height Ġ> Ġ 1 ) Ġ{ ĊĠĠĠĠĠ Ġfor Ġ( i Ġin Ġ 1 .. branch ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsub root . addChild ( H Node Tree ( depth Ġ+ Ġ 1 , Ġheight Ġ- Ġ 1 , Ġbranch )) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġsub root ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġget Fake Action Key () Ġ= Ġwhen Ġ( is Mac ) Ġ{ ĊĠĠĠ Ġtrue Ġ-> ĠFake Keyboard . Key . META ĊĠĠĠ Ġfalse Ġ-> ĠFake Keyboard . Key . CTRL ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Drag To East () Ġ{ ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 0 . 0 , Ġ 6 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 1 0 , Ġ 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 7 . 5 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 5 7 . 5 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Over Drag To East () Ġ{ ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 0 . 0 , Ġ 6 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 9 0 , Ġ 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 5 0 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Drag To West () Ġ{ ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 0 . 0 , Ġ 6 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 3 , Ġ 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 1 1 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 6 1 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Over Drag To West () Ġ{ ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 0 . 0 , Ġ 6 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 9 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 5 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Drag ToS outh () Ġ{ ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 7 ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 2 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 2 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Over Drag ToS outh () Ġ{ ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 4 5 ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min . toInt ()). isEqualTo ( my Total Height Ġ- Ġmy View Height ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max . toInt ()). isEqualTo ( my Total Height Ġ- Ġmy View Height ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Drag To North () Ġ{ ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 1 ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 6 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 6 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Over Drag To North () Ġ{ ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 4 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 5 ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min . toInt ()). isEqualTo ( my Initial Y Position ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max . toInt ()). isEqualTo ( my Initial Y Position ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Drag South When Chart T aller Than Tree () Ġ{ ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġ// ĠResize Ġthe Ġchart Ġso Ġthe Ġview 's Ġheight Ġis Ġlarger Ġthan Ġthe Ġcontent 's . ĊĠĠĠ Ġ// ĠThe Ġdrag Ġshould Ġbe Ġno - op . ĊĠĠĠ Ġmy Chart . size Ġ= ĠDimension ( 1 0 0 , Ġmy Total Height Ġ+ Ġ 2 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 7 ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Mouse Drag East South () Ġ{ ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 0 . 0 , Ġ 6 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 7 , Ġ 1 0 ) ĊĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 9 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 5 9 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 5 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 5 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Top Down Chart Drag ToS outh () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 1 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 5 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 5 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Top Down Chart Over Drag ToS outh () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 4 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . min . toInt ()). isEqualTo ( my Initial Y Position ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max . toInt ()). isEqualTo ( my Initial Y Position ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Top Down Chart Drag To North () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 5 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 5 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Top Down Chart Over Drag To North () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ Ġmy Ui . mouse . press ( 5 , Ġ 4 5 ) ĊĠĠĠ Ġmy Ui . mouse . drag To ( 5 , Ġ 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . min . toInt ()). isEqualTo ( my Total Height Ġ- Ġmy View Height ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max . toInt ()). isEqualTo ( my Total Height Ġ- Ġmy View Height ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Chart Mouse Wheel Zoom In () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġmy Ui . keyboard . press ( get Fake Action Key ()) ĊĠĠĠ Ġmy Ui . mouse . wheel ( 4 0 , Ġ 2 0 , Ġ- 1 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 2 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 9 7 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Chart Mouse Wheel Zoom Out () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 0 . 0 , Ġ 6 0 . 0 ) ĊĠĠĠ Ġmy Ui . keyboard . press ( get Fake Action Key ()) ĊĠĠĠ Ġmy Ui . mouse . wheel ( 4 0 , Ġ 2 0 , Ġ 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 5 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 6 7 . 5 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Chart Mouse Wheel Over Zoom Out Left () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 . 0 , Ġ 5 1 . 0 ) ĊĠĠĠ Ġmy Ui . keyboard . press ( get Fake Action Key ()) ĊĠĠĠ Ġmy Ui . mouse . wheel ( 8 0 , Ġ 2 0 , Ġ 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 5 3 . 5 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Chart Mouse Wheel Over Zoom Out Right () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 4 9 . 0 , Ġ 9 9 . 0 ) ĊĠĠĠ Ġmy Ui . keyboard . press ( get Fake Action Key ()) ĊĠĠĠ Ġmy Ui . mouse . wheel ( 2 0 , Ġ 2 0 , Ġ 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 4 6 . 5 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Chart Mouse Wheel Over Zoom Out Both Side s () Ġ{ ĊĠĠĠ ĠsetUp ( HT ree Chart . Orientation . TOP _ DOWN ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠĠĠ Ġ// ĠZoom Ġin Ġby Ġ 2 X . ĠOnly Ġz oo med - in Ġchart Ġsupports Ġhorizontal Ġdrag . ĊĠĠĠ Ġmy Range . set ( 1 0 . 0 , Ġ 9 0 . 0 ) ĊĠĠĠ Ġmy Ui . keyboard . press ( get Fake Action Key ()) ĊĠĠĠ Ġmy Ui . mouse . wheel ( 2 5 , Ġ 2 0 , Ġ 1 5 ) ĊĠĠĠ ĠassertThat ( my Range . min ). is Within ( EPS ILON ). of ( 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Range . max ). is Within ( EPS ILON ). of ( 1 0 0 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Chart Mouse Wheel Scroll Up () Ġ{ ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġmy Ui . mouse . wheel ( 2 5 , Ġ 2 5 , Ġ 1 ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 2 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 2 . 0 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Chart Mouse Wheel Scroll Down () Ġ{ ĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 0 . 0 ) ĊĊĠĠĠ Ġmy Ui . mouse . wheel ( 2 5 , Ġ 2 5 , Ġ- 1 ) ĊĊĠĠĠ ĠassertThat ( my Chart . y Range . min ). is Within ( EPS ILON ). of ( 1 8 . 0 ) ĊĠĠĠ ĠassertThat ( my Chart . y Range . max ). is Within ( EPS ILON ). of ( 1 8 . 0 ) ĊĠ Ġ} ĊĊĠ Ġclass ĠFake Renderer Ġ: ĠDefault H Renderer < String >() Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġget Fill Color ( node Data : ĠString ) Ġ= ĠColor . white ĊĊĠĠĠ Ġoverride Ġfun Ġgenerate Fit ting Text ( node Data : ĠString , Ġrect : ĠRectangle 2 D , Ġfont Metrics : ĠFont Metrics ) Ġ= Ġ"" ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġprivate Ġval ĠEPS ILON Ġ= Ġ 1 e - 3 ĊĠ Ġ} Ċ } Ċ