diff options
author | tripun <tripun@gmail.com> | 2014-07-28 18:36:57 +0530 |
---|---|---|
committer | tripun <tripun@gmail.com> | 2014-08-11 21:01:24 +0530 |
commit | 6f39d1169d67de29927a7bfe16c389075a6a9a43 (patch) | |
tree | 88b7bca784068fd5f1742baa0238607bae222107 /test/unit/t_balance.cc | |
parent | d6d37516fd1ccf6b57e196bd946306b7be6941d0 (diff) | |
download | fork-ledger-6f39d1169d67de29927a7bfe16c389075a6a9a43.tar.gz fork-ledger-6f39d1169d67de29927a7bfe16c389075a6a9a43.tar.bz2 fork-ledger-6f39d1169d67de29927a7bfe16c389075a6a9a43.zip |
add balance Test constructors
Diffstat (limited to 'test/unit/t_balance.cc')
-rw-r--r-- | test/unit/t_balance.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/unit/t_balance.cc b/test/unit/t_balance.cc index 0d681a88..dfa96821 100644 --- a/test/unit/t_balance.cc +++ b/test/unit/t_balance.cc @@ -28,6 +28,26 @@ struct balance_fixture { } }; -//BOOST_FIXTURE_TEST_SUITE(balance, balance_fixture) +BOOST_FIXTURE_TEST_SUITE(balance, balance_fixture) -//BOOST_AUTO_TEST_SUITE_END() +BOOST_AUTO_TEST_CASE(testConstructors) +{ + balance_t b0; + balance_t b1(1.00); + balance_t b2(12345UL); + balance_t b3(123456L); + + BOOST_CHECK_EQUAL(balance_t(), b0); + BOOST_CHECK_NE(balance_t("0"), b0); + BOOST_CHECK_NE(balance_t("0.0"), b0); + BOOST_CHECK_EQUAL(balance_t(12345UL), 12345UL); + BOOST_CHECK_EQUAL(balance_t(123456L), 123456L); + + BOOST_CHECK(b0.valid()); + BOOST_CHECK(b1.valid()); + BOOST_CHECK(b2.valid()); + BOOST_CHECK(b3.valid()); + +} + +BOOST_AUTO_TEST_SUITE_END() |