diff options
author | tripun <tripun@gmail.com> | 2014-08-11 02:30:01 +0530 |
---|---|---|
committer | tripun <tripun@gmail.com> | 2014-08-11 21:01:26 +0530 |
commit | 7e817d45d9c5a7cdee5d5df59e9794e8512a0d9a (patch) | |
tree | 0d2f2c9bc1b0815437bebe4d99434a1a78e01737 /test/unit/t_balance.cc | |
parent | c5f41b85195cb3f671888289071d26531f198a80 (diff) | |
download | fork-ledger-7e817d45d9c5a7cdee5d5df59e9794e8512a0d9a.tar.gz fork-ledger-7e817d45d9c5a7cdee5d5df59e9794e8512a0d9a.tar.bz2 fork-ledger-7e817d45d9c5a7cdee5d5df59e9794e8512a0d9a.zip |
add unit test Truth for balance_t
Diffstat (limited to 'test/unit/t_balance.cc')
-rw-r--r-- | test/unit/t_balance.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/t_balance.cc b/test/unit/t_balance.cc index 8f21e23f..468f03bb 100644 --- a/test/unit/t_balance.cc +++ b/test/unit/t_balance.cc @@ -476,4 +476,24 @@ BOOST_AUTO_TEST_CASE(testRound) BOOST_CHECK(b4.valid()); } +BOOST_AUTO_TEST_CASE(testTruth) +{ + amount_t a1("0.00"); + amount_t a2("$ 123"); + amount_t a3("EUR 456"); + + balance_t b0; + balance_t b1; + + b1 += a1; + b1 += a2; + b1 += a3; + + BOOST_CHECK(!b0); + BOOST_CHECK(b1); + + BOOST_CHECK(b0.valid()); + BOOST_CHECK(b1.valid()); +} + BOOST_AUTO_TEST_SUITE_END() |