Skip to content

Commit

Permalink
Adds test for method stripping trailing zeros 🧪
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobvogel committed Mar 21, 2024
1 parent 532dec2 commit 8ca81eb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/kotlin/sirius/kernel/commons/AmountTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,20 @@ class AmountTest {

assertEquals(result, a.remainder(b))
}

@ParameterizedTest
@CsvSource(
delimiter = '|', textBlock = """
0.420 | 0.42
1.0 | 1
200 | 200
200.0000 | 200
600.010 | 600.01"""
)
fun `getAmountWithoutTrailingZeros() works as expected`(
@ConvertWith(AmountConverter::class) a: Amount,
result: String,
) {
assertEquals(result, a.fetchAmountWithoutTrailingZeros()?.toPlainString())
}
}

0 comments on commit 8ca81eb

Please sign in to comment.