diff options
Diffstat (limited to 'sandbox/src/test/kotlin/BalanceTest.kt')
-rw-r--r-- | sandbox/src/test/kotlin/BalanceTest.kt | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sandbox/src/test/kotlin/BalanceTest.kt b/sandbox/src/test/kotlin/BalanceTest.kt index cf9f3918..aabf2051 100644 --- a/sandbox/src/test/kotlin/BalanceTest.kt +++ b/sandbox/src/test/kotlin/BalanceTest.kt @@ -4,6 +4,7 @@ import org.jetbrains.exposed.sql.transactions.transaction import org.junit.Test import tech.libeufin.sandbox.* import tech.libeufin.util.millis +import tech.libeufin.util.roundToTwoDigits import java.math.BigDecimal import java.time.LocalDateTime @@ -28,7 +29,14 @@ class BalanceTest { iban = "IBAN 1" bic = "BIC" label = "label 1" - owner = "test" + owner = "admin" + this.demoBank = demobank + } + val other = BankAccountEntity.new { + iban = "IBAN 2" + bic = "BIC" + label = "label 2" + owner = "admin" this.demoBank = demobank } BankAccountTransactionEntity.new { @@ -82,7 +90,18 @@ class BalanceTest { accountServicerReference = "test-account-servicer-reference" this.demobank = demobank } - assert(BigDecimal.ONE == getBalance(one, withPending = true)) + wireTransfer( + other, one, demobank, "one gets 1", "EUR:1" + ) + wireTransfer( + other, one, demobank, "one gets another 1", "EUR:1" + ) + wireTransfer( + one, other, demobank, "one gives 1", "EUR:1" + ) + val maybeOneBalance: BigDecimal = getBalance(one) + println(maybeOneBalance) + assert(BigDecimal.ONE.roundToTwoDigits() == maybeOneBalance.roundToTwoDigits()) } } } |