package Ġcom . mon otonic . digits čĊč Ċ import Ġcom . mon otonic . digits . evaluator . Quantity č Ċ import Ġcom . mon otonic . digits . evaluator . S ci Number č Ċ import Ġcom . mon otonic . digits . units . Dimension Bag č Ċ import Ġcom . mon otonic . digits . units . Natural Unit č Ċ import Ġorg . junit . Assert . assertEquals č Ċ import Ġorg . junit . Test čĊč Ċ /** čĊ Ġ* Ġ@ author ĠE than čĊ Ġ*/ č Ċ class ĠQuantity Test Ġ{ čĊĠĠĠ Ġval Ġmeters Ġ= ĠNatural Unit ( map Of (" length " Ġto Ġ 1 )) čĊĠĠĠ Ġval Ġk ilo meters Ġ= ĠNatural Unit ( Dimension Bag (" length " Ġto Ġ 1 ), ĠK ilo ) čĊčĊĠĠĠ Ġ@ Test čĊĠĠĠ Ġfun Ġplus () Ġ{ čĊĠĠĠĠĠĠĠ ĠassertEquals ( q (" 4 5 6 . 1 2 3 ", Ġk ilo meters ), Ġq (" 1 2 3 ", Ġmeters ) Ġ+ Ġq (" 4 5 6 . 0 0 0 ", Ġk ilo meters )) čĊĠĠĠĠĠĠĠ ĠassertEquals ( q (" 1 2 3 . 4 5 6 ", Ġk ilo meters ), Ġq (" 1 2 3 . 0 0 0 ", Ġk ilo meters ) Ġ+ Ġq (" 4 5 6 ", Ġmeters )) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Test čĊĠĠĠ Ġfun Ġminus () Ġ{ čĊĠĠĠĠĠĠĠ ĠassertEquals ( q ("- 1 ", Ġmeters ), Ġq (" 4 ", Ġmeters ) Ġ- Ġq (" 5 ", Ġmeters )) čĊĠĠĠĠĠĠĠ ĠassertEquals ( q (" 1 ", Ġmeters ), Ġq (" 5 ", Ġmeters ) Ġ- Ġq (" 4 ", Ġmeters )) čĊčĊĠĠĠĠĠĠĠ ĠassertEquals ( Quantity ( S ci Number . Real (". 9 9 9 ", Ġsf ( 0 )), Ġk ilo meters ), Ġq (" 1 ", Ġk ilo meters ) Ġ- Ġq (" 1 ", Ġmeters )) čĊĠĠĠĠĠĠĠ ĠassertEquals ( Quantity ( S ci Number . Real (". 9 9 9 ", Ġsf ( 1 )), Ġk ilo meters ), Ġq (" 1 . 0 ", Ġk ilo meters ) Ġ- Ġq (" 1 ", Ġmeters )) čĊĠĠĠĠĠĠĠ ĠassertEquals ( Quantity ( S ci Number . Real ("- 9 9 9 ", Ġsf ( 0 )), Ġmeters ), Ġq (" 1 ", Ġmeters ) Ġ- Ġq (" 1 ", Ġk ilo meters )) Ġ// ĠShould Ġonly Ġhave Ġone Ġsig fig čĊĠĠĠ Ġ} č Ċ }