From 7e817d45d9c5a7cdee5d5df59e9794e8512a0d9a Mon Sep 17 00:00:00 2001 From: tripun Date: Mon, 11 Aug 2014 02:30:01 +0530 Subject: add unit test Truth for balance_t --- test/unit/t_balance.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/unit/t_balance.cc') 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() -- cgit v1.2.3