package Ġjump aku . cur ves . core . test . fuzzy Ċ Ċ import Ġjump aku . commons . control . result Ċ import Ġjump aku . commons . math . test . close To Ċ import Ġjump aku . cur ves . core . fuzzy . Grade Ċ import Ġorg . hamcrest . Core Matchers .` is ` Ċ import Ġorg . hamcrest . Matchers .* Ċ import Ġorg . junit . Assert . assertThat Ċ import Ġorg . junit . Test Ċ Ċ class ĠGr ade Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Constructor Exception () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" Constructor Exception ") ĊĠĠĠĠĠĠĠ Ġval Ġa 0 Ġ= Ġresult Ġ{ ĠGr ade (- 0 . 5 ) Ġ}. error (). or Throw () ĊĠĠĠĠĠĠĠ Ġval Ġa 1 Ġ= Ġresult Ġ{ ĠGr ade ( 1 . 5 ) Ġ}. error (). or Throw () ĊĠĠĠĠĠĠĠ Ġval Ġa 2 Ġ= Ġresult Ġ{ ĠGr ade ( Double . NaN ) Ġ}. error (). or Throw () ĊĠĠĠĠĠĠĠ Ġval Ġa 3 Ġ= Ġresult Ġ{ ĠGr ade ( Double . NEGATIVE _ INFINITY ) Ġ}. error (). or Throw () ĊĠĠĠĠĠĠĠ Ġval Ġa 4 Ġ= Ġresult Ġ{ ĠGr ade ( Double . POSITIVE _ INFINITY ) Ġ}. error (). or Throw () ĊĠĠĠĠĠĠĠ Ġval Ġe Ġ= ĠIllegalArgumentException :: class . java ĊĠĠĠĠĠĠĠ ĠassertThat ( a 0 , Ġ` is `( instance Of ( e ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( a 1 , Ġ` is `( instance Of ( e ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( a 2 , Ġ` is `( instance Of ( e ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( a 3 , Ġ` is `( instance Of ( e ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( a 4 , Ġ` is `( instance Of ( e ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest To Grade () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" To Grade ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( true ). value , Ġ` is `( close To ( 1 . 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( false ). value , Ġ` is `( close To ( 0 . 0 ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest To Boolean () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" To Boolean ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 0 ). to Boolean ( 0 . 5 , Ġtrue ), Ġ` is `( false )) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 5 ). to Boolean ( 0 . 5 , Ġtrue ), Ġ` is `( true )) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 5 ). to Boolean ( 0 . 5 , Ġfalse ), Ġ` is `( false )) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 1 . 0 ). to Boolean ( 0 . 5 , Ġtrue ), Ġ` is `( true )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest CompareTo () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" CompareTo ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 3 ). compareTo ( Grade ( 0 . 8 )), Ġ` is `( less Than ( 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 9 ). compareTo ( Grade ( 0 . 8 )), Ġ` is `( greater Than ( 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 8 ). compareTo ( Grade ( 0 . 8 )), Ġ` is `( equalTo ( 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 3 ) Ġ< ĠGr ade ( 0 . 8 )), Ġ` is `( true )) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 3 ) Ġ<= ĠGr ade ( 0 . 8 )), Ġ` is `( true )) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 9 ) Ġ> ĠGr ade ( 0 . 8 )), Ġ` is `( true )) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 9 ) Ġ>= ĠGr ade ( 0 . 8 )), Ġ` is `( true )) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 8 ) Ġ<= ĠGr ade ( 0 . 8 )), Ġ` is `( true )) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 8 ) Ġ>= ĠGr ade ( 0 . 8 )), Ġ` is `( true )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest And () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" And ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 3 ). and ( Grade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 3 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 9 ). and ( Grade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 8 ). and ( Grade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 3 ) Ġand ĠGr ade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 3 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 9 ) Ġand ĠGr ade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 8 ) Ġand ĠGr ade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Or () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" Or ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 3 ). or ( Grade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 9 ). or ( Grade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 9 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 8 ). or ( Grade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 3 ) Ġor ĠGr ade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 9 ) Ġor ĠGr ade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 9 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( Grade ( 0 . 8 ) Ġor ĠGr ade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 8 ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Not () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" Not ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 3 ). not (). value , Ġ` is `( close To ( 0 . 7 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 9 ). not (). value , Ġ` is `( close To ( 0 . 1 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 8 ). not (). value , Ġ` is `( close To ( 0 . 2 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( ! Grade ( 0 . 3 )). value , Ġ` is `( close To ( 0 . 7 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( ! Grade ( 0 . 9 )). value , Ġ` is `( close To ( 0 . 1 ))) ĊĠĠĠĠĠĠĠ ĠassertThat (( ! Grade ( 0 . 8 )). value , Ġ` is `( close To ( 0 . 2 ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest GetValue () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" GetValue ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 1 . 0 ). value , Ġ` is `( close To ( 1 . 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 0 ). value , Ġ` is `( close To ( 0 . 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade ( 0 . 5 ). value , Ġ` is `( close To ( 0 . 5 ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Clamp () Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln (" Clamp ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade . clamp ed ( 1 . 5 ). value , Ġ` is `( close To ( 1 . 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade . clamp ed ( 1 . 0 ). value , Ġ` is `( close To ( 1 . 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade . clamp ed ( 0 . 5 ). value , Ġ` is `( close To ( 0 . 5 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade . clamp ed ( 0 . 0 ). value , Ġ` is `( close To ( 0 . 0 ))) ĊĠĠĠĠĠĠĠ ĠassertThat ( Grade . clamp ed (- 0 . 5 ). value , Ġ` is `( close To ( 0 . 0 ))) ĊĠĠĠ Ġ} Ċ } ĊĊ