package Ġtests Ċ Ċ import Ġio . fluid sonic . currency .* Ċ import Ġkotlin . test .* ĊĊ Ċ class ĠCurrency Code Tests Ġ{ ĊĊ ĉ @ Test Ċ ĉ fun Ġtest Equals And HashCode () Ġ{ Ċĉ ĉ assertEquals ( expected Ġ= ĠCurrency Code . parse (" EUR "), Ġactual Ġ= ĠCurrency Code . parse (" eur ")) Ċĉ ĉ assertEquals ( expected Ġ= ĠCurrency Code . parse (" EUR "). hashCode (), Ġactual Ġ= ĠCurrency Code . parse (" eur "). hashCode ()) Ċ ĉ } ĊĊĊ ĉ @ Test Ċ ĉ fun Ġtest IsValid () Ġ{ Ċĉ ĉ assertTrue ( Currency Code . parse (" eur "). isValid ()) Ċĉ ĉ assertFalse ( Currency Code . parse (" abc "). isValid ()) Ċ ĉ } ĊĊĊ ĉ @ Test Ċ ĉ fun Ġtest Parse And ToString () Ġ{ Ċĉ ĉ assertEquals ( expected Ġ= Ġ" EUR ", Ġactual Ġ= ĠCurrency Code . parse (" EUR "). toString ()) Ċĉ ĉ assertEquals ( expected Ġ= Ġ" ABC ", Ġactual Ġ= ĠCurrency Code . parse (" abc "). toString ()) ĊĊĉ ĉ assertEquals ( Ċĉĉ ĉ expected Ġ= Ġ" Invalid ĠISO Ġ 4 2 1 7 Ġcurrency Ġcode Ġformat : Ġab 1 ", Ċĉĉ ĉ actual Ġ= Ġassert Fails Ġ{ ĠCurrency Code . parse (" ab 1 ") Ġ}. message Ċĉ ĉ ) Ċ ĉ } Ċ } Ċ