diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-30 06:26:38 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:33 -0400 |
commit | c8899addfd2deed3d84be2de234681db64987722 (patch) | |
tree | 07f9a5eb603ff4ec83fe18c83083575d2b7a439a /tests/numerics/BasicAmount.h | |
parent | aa9cc125796711afcaa459898e95527fdae8e912 (diff) | |
download | fork-ledger-c8899addfd2deed3d84be2de234681db64987722.tar.gz fork-ledger-c8899addfd2deed3d84be2de234681db64987722.tar.bz2 fork-ledger-c8899addfd2deed3d84be2de234681db64987722.zip |
Rearranged the sources a bit.
Diffstat (limited to 'tests/numerics/BasicAmount.h')
-rw-r--r-- | tests/numerics/BasicAmount.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/numerics/BasicAmount.h b/tests/numerics/BasicAmount.h new file mode 100644 index 00000000..2c107f45 --- /dev/null +++ b/tests/numerics/BasicAmount.h @@ -0,0 +1,68 @@ +#ifndef _BASICAMOUNT_H +#define _BASICAMOUNT_H + +#include "UnitTests.h" + +class BasicAmountTestCase : public CPPUNIT_NS::TestCase +{ + CPPUNIT_TEST_SUITE(BasicAmountTestCase); + + CPPUNIT_TEST(testConstructors); + CPPUNIT_TEST(testNegation); + CPPUNIT_TEST(testAssignment); + CPPUNIT_TEST(testEquality); + CPPUNIT_TEST(testIntegerAddition); + CPPUNIT_TEST(testFractionalAddition); + CPPUNIT_TEST(testIntegerSubtraction); + CPPUNIT_TEST(testFractionalSubtraction); + CPPUNIT_TEST(testIntegerMultiplication); + CPPUNIT_TEST(testFractionalMultiplication); + CPPUNIT_TEST(testIntegerDivision); + CPPUNIT_TEST(testFractionalDivision); + CPPUNIT_TEST(testIntegerConversion); + CPPUNIT_TEST(testFractionalConversion); + CPPUNIT_TEST(testFractionalRound); + CPPUNIT_TEST(testTruth); + CPPUNIT_TEST(testForZero); + CPPUNIT_TEST(testComparisons); + CPPUNIT_TEST(testSign); + CPPUNIT_TEST(testAbs); + CPPUNIT_TEST(testPrinting); + + CPPUNIT_TEST_SUITE_END(); + +public: + BasicAmountTestCase() {} + virtual ~BasicAmountTestCase() {} + + virtual void setUp(); + virtual void tearDown(); + + void testConstructors(); + void testNegation(); + void testAssignment(); + void testEquality(); + void testIntegerAddition(); + void testFractionalAddition(); + void testIntegerSubtraction(); + void testFractionalSubtraction(); + void testIntegerMultiplication(); + void testFractionalMultiplication(); + void testIntegerDivision(); + void testFractionalDivision(); + void testIntegerConversion(); + void testFractionalConversion(); + void testFractionalRound(); + void testTruth(); + void testForZero(); + void testComparisons(); + void testSign(); + void testAbs(); + void testPrinting(); + +private: + BasicAmountTestCase(const BasicAmountTestCase ©); + void operator=(const BasicAmountTestCase ©); +}; + +#endif /* _BASICAMOUNT_H */ |