summaryrefslogtreecommitdiff
path: root/tests/numerics/t_amount.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-07 10:43:15 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:40 -0400
commit39b0a03f8281c2ee7af57326d49dcedd1eb29a47 (patch)
treeffc7cc9838f784aa22db16b882f81dcf6d01aca4 /tests/numerics/t_amount.h
parent6ec2f6b59be2fe8e621e97a39836e7033fd0f240 (diff)
downloadfork-ledger-39b0a03f8281c2ee7af57326d49dcedd1eb29a47.tar.gz
fork-ledger-39b0a03f8281c2ee7af57326d49dcedd1eb29a47.tar.bz2
fork-ledger-39b0a03f8281c2ee7af57326d49dcedd1eb29a47.zip
Changed the filenames of the tests.
Diffstat (limited to 'tests/numerics/t_amount.h')
-rw-r--r--tests/numerics/t_amount.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/tests/numerics/t_amount.h b/tests/numerics/t_amount.h
new file mode 100644
index 00000000..ee227a5c
--- /dev/null
+++ b/tests/numerics/t_amount.h
@@ -0,0 +1,106 @@
+#ifndef _T_AMOUNT_H
+#define _T_AMOUNT_H
+
+#include "UnitTests.h"
+
+class BasicAmountTestCase : public CPPUNIT_NS::TestCase
+{
+ CPPUNIT_TEST_SUITE(BasicAmountTestCase);
+
+ CPPUNIT_TEST(testConstructors);
+ CPPUNIT_TEST(testAssignment);
+ CPPUNIT_TEST(testEquality);
+ CPPUNIT_TEST(testComparisons);
+ 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(testNegation);
+ CPPUNIT_TEST(testAbs);
+ CPPUNIT_TEST(testFractionalRound);
+ CPPUNIT_TEST(testReduction);
+ CPPUNIT_TEST(testSign);
+ CPPUNIT_TEST(testTruth);
+ CPPUNIT_TEST(testForZero);
+ CPPUNIT_TEST(testIntegerConversion);
+ CPPUNIT_TEST(testFractionalConversion);
+ CPPUNIT_TEST(testPrinting);
+ CPPUNIT_TEST(testCommodityConstructors);
+ CPPUNIT_TEST(testCommodityNegation);
+ CPPUNIT_TEST(testCommodityAssignment);
+ CPPUNIT_TEST(testCommodityEquality);
+ CPPUNIT_TEST(testCommodityAddition);
+ CPPUNIT_TEST(testCommoditySubtraction);
+ CPPUNIT_TEST(testCommodityMultiplication);
+ CPPUNIT_TEST(testCommodityDivision);
+ CPPUNIT_TEST(testCommodityConversion);
+ CPPUNIT_TEST(testCommodityRound);
+ CPPUNIT_TEST(testCommodityDisplayRound);
+ CPPUNIT_TEST(testCommodityTruth);
+ CPPUNIT_TEST(testCommodityForZero);
+ CPPUNIT_TEST(testCommodityComparisons);
+ CPPUNIT_TEST(testCommoditySign);
+ CPPUNIT_TEST(testCommodityAbs);
+ CPPUNIT_TEST(testCommodityPrinting);
+
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ ledger::session_t session;
+
+ BasicAmountTestCase() {}
+ virtual ~BasicAmountTestCase() {}
+
+ virtual void setUp();
+ virtual void tearDown();
+
+ void testConstructors();
+ void testAssignment();
+ void testEquality();
+ void testComparisons();
+ void testIntegerAddition();
+ void testFractionalAddition();
+ void testIntegerSubtraction();
+ void testFractionalSubtraction();
+ void testIntegerMultiplication();
+ void testFractionalMultiplication();
+ void testIntegerDivision();
+ void testFractionalDivision();
+ void testNegation();
+ void testAbs();
+ void testFractionalRound();
+ void testReduction();
+ void testSign();
+ void testTruth();
+ void testForZero();
+ void testIntegerConversion();
+ void testFractionalConversion();
+ void testPrinting();
+ void testCommodityConstructors();
+ void testCommodityNegation();
+ void testCommodityAssignment();
+ void testCommodityEquality();
+ void testCommodityAddition();
+ void testCommoditySubtraction();
+ void testCommodityMultiplication();
+ void testCommodityDivision();
+ void testCommodityConversion();
+ void testCommodityRound();
+ void testCommodityDisplayRound();
+ void testCommodityTruth();
+ void testCommodityForZero();
+ void testCommodityComparisons();
+ void testCommoditySign();
+ void testCommodityAbs();
+ void testCommodityPrinting();
+
+private:
+ BasicAmountTestCase(const BasicAmountTestCase &copy);
+ void operator=(const BasicAmountTestCase &copy);
+};
+
+#endif // _T_AMOUNT_H