package Ġfr . ac in q . lightning Ċ Ċ import Ġfr . ac in q . bitcoin . Sat oshi Ċ import Ġfr . ac in q . lightning . tests . utils . Lightning TestSuite Ċ import Ġfr . ac in q . lightning . utils . ms at Ċ import Ġfr . ac in q . lightning . utils . sat Ċ import Ġfr . ac in q . lightning . utils . to Milli Sat oshi Ċ import Ġkotlin . test . Test Ċ import Ġkotlin . test . assertEquals Ċ import Ġkotlin . test . assertTrue Ċ Ċ class ĠM illi Sat oshi Tests Common Ġ: ĠLight ning TestSuite () Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` millis atos hi Ġnumeric Ġoperations `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġadd ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 5 6 1 ), ĠM illi Sat oshi ( 5 6 1 ) Ġ+ Ġ 0 . ms at ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 5 6 1 ), ĠM illi Sat oshi ( 5 6 1 ) Ġ+ Ġ 0 . sat . to Milli Sat oshi ()) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 1 6 6 6 ), ĠM illi Sat oshi ( 5 6 1 ) Ġ+ Ġ 1 1 0 5 . ms at ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 5 0 0 0 ), ĠM illi Sat oshi ( 2 0 0 0 ) Ġ+ Ġ 3 . sat . to Milli Sat oshi ()) ĊĊĠĠĠĠĠĠĠ Ġ// Ġsubtract ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 5 6 1 ), ĠM illi Sat oshi ( 5 6 1 ) Ġ- Ġ 0 . ms at ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 5 4 4 ), ĠM illi Sat oshi ( 1 1 0 5 ) Ġ- Ġ 5 6 1 . ms at ) ĊĠĠĠĠĠĠĠ ĠassertEquals (- Milli Sat oshi ( 5 4 4 ), Ġ 5 6 1 . ms at Ġ- Ġ 1 1 0 5 . ms at ) ĊĠĠĠĠĠĠĠ ĠassertEquals (- Milli Sat oshi ( 5 4 4 ), ĠM illi Sat oshi ( 5 6 1 ) Ġ- Ġ 1 1 0 5 . ms at ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 1 0 5 ), ĠM illi Sat oshi ( 1 1 0 5 ) Ġ- Ġ 1 . sat . to Milli Sat oshi ()) ĊĊĠĠĠĠĠĠĠ Ġ// Ġmultiply ĊĠĠĠĠĠĠĠ ĠassertEquals ( 5 6 1 . ms at , ĠM illi Sat oshi ( 5 6 1 ) Ġ* Ġ 1 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 1 2 2 . ms at , ĠM illi Sat oshi ( 5 6 1 ) Ġ* Ġ 2 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 4 0 2 . ms at , ĠM illi Sat oshi ( 5 6 1 ) Ġ* Ġ 2 . 5 ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġdivide ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 5 6 1 ), ĠM illi Sat oshi ( 5 6 1 ) Ġ/ Ġ 1 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 2 8 0 ), ĠM illi Sat oshi ( 5 6 1 ) Ġ/ Ġ 2 ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġcompare ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 5 6 1 ) Ġ<= ĠM illi Sat oshi ( 5 6 1 )) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 5 6 1 ) Ġ<= Ġ 1 1 0 5 . ms at ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 5 6 1 ) Ġ< ĠM illi Sat oshi ( 1 1 0 5 )) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 5 6 1 ) Ġ>= ĠM illi Sat oshi ( 5 6 1 )) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 1 1 0 5 ) Ġ>= ĠM illi Sat oshi ( 5 6 1 )) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 1 1 0 5 ) Ġ> ĠM illi Sat oshi ( 5 6 1 )) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 1 0 0 0 ) Ġ<= ĠSat oshi ( 1 ). to Milli Sat oshi ()) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 1 0 0 0 ) Ġ<= Ġ 2 . sat . to Milli Sat oshi ()) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 1 0 0 0 ) Ġ< ĠSat oshi ( 2 ). to Milli Sat oshi ()) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 1 0 0 0 ) Ġ>= ĠSat oshi ( 1 ). to Milli Sat oshi ()) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 2 0 0 0 ) Ġ>= ĠSat oshi ( 1 ). to Milli Sat oshi ()) ĊĠĠĠĠĠĠĠ ĠassertTrue ( Milli Sat oshi ( 2 0 0 0 ) Ġ> ĠSat oshi ( 1 ). to Milli Sat oshi ()) ĊĊĠĠĠĠĠĠĠ Ġ// Ġmax Of ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 1 1 0 5 ), Ġ( 5 6 1 . ms at ). coerce At Least ( 1 1 0 5 . ms at )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 1 1 0 5 ), Ġ( 1 1 0 5 . ms at ). coerce At Least ( 1 . sat . to Milli Sat oshi ())) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 2 0 0 0 ), Ġ( 1 1 0 5 . ms at ). coerce At Least ( 2 . sat . to Milli Sat oshi ())) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Sat oshi ( 2 ), Ġ( 1 . sat ). max ( 2 . sat )) ĊĊĠĠĠĠĠĠĠ Ġ// Ġmin Of ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 5 6 1 ), Ġ( 5 6 1 . ms at ). coerce At Most ( 1 1 0 5 . ms at )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 1 0 0 0 ), Ġ( 1 1 0 5 . ms at ). coerce At Most ( 1 . sat . to Milli Sat oshi ())) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Milli Sat oshi ( 1 1 0 5 ), Ġ( 1 1 0 5 . ms at ). coerce At Most ( 2 . sat . to Milli Sat oshi ())) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Sat oshi ( 1 ), Ġ( 1 . sat ). min ( 2 . sat )) ĊĠĠĠ Ġ} Ċ Ċ } Ċ