diff options
Diffstat (limited to 'tests/corelib/numerics')
-rw-r--r-- | tests/corelib/numerics/Commodity.cc | 40 | ||||
-rw-r--r-- | tests/corelib/numerics/Commodity.h | 36 | ||||
-rw-r--r-- | tests/corelib/numerics/CommodityAmount.cc | 20 | ||||
-rw-r--r-- | tests/corelib/numerics/CommodityAmount.h | 8 |
4 files changed, 76 insertions, 28 deletions
diff --git a/tests/corelib/numerics/Commodity.cc b/tests/corelib/numerics/Commodity.cc new file mode 100644 index 00000000..77cdd7b9 --- /dev/null +++ b/tests/corelib/numerics/Commodity.cc @@ -0,0 +1,40 @@ +#include "Commodity.h" +#include "ledger.h" + +using namespace ledger; + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(CommodityTestCase, "numerics"); + +void CommodityTestCase::setUp() {} +void CommodityTestCase::tearDown() {} + +void CommodityTestCase::testConstructors() +{ + +} + +void CommodityTestCase::testPriceHistory() +{ + // jww (2007-04-17): tbd + amount_t x1("100.10 AAPL"); + + assertEqual(x1, x1.value(datetime_t())); + + assertValid(x1); +} + +void CommodityTestCase::testLots() +{ + // jww (2007-04-17): tbd +} + +void CommodityTestCase::testScalingBase() +{ + // jww (2007-04-17): tbd +} + +void CommodityTestCase::testReduction() +{ + // jww (2007-04-17): tbd +} + diff --git a/tests/corelib/numerics/Commodity.h b/tests/corelib/numerics/Commodity.h new file mode 100644 index 00000000..46af6ecf --- /dev/null +++ b/tests/corelib/numerics/Commodity.h @@ -0,0 +1,36 @@ +#ifndef _COMMMODITY_H +#define _COMMMODITY_H + +#include "UnitTests.h" + +class CommodityTestCase : public CPPUNIT_NS::TestCase +{ + CPPUNIT_TEST_SUITE(CommodityTestCase); + + CPPUNIT_TEST(testConstructors); + CPPUNIT_TEST(testPriceHistory); + CPPUNIT_TEST(testLots); + CPPUNIT_TEST(testScalingBase); + CPPUNIT_TEST(testReduction); + + CPPUNIT_TEST_SUITE_END(); + +public: + CommodityTestCase() {} + virtual ~CommodityTestCase() {} + + virtual void setUp(); + virtual void tearDown(); + + void testConstructors(); + void testPriceHistory(); + void testLots(); + void testScalingBase(); + void testReduction(); + +private: + CommodityTestCase(const CommodityTestCase ©); + void operator=(const CommodityTestCase ©); +}; + +#endif /* _COMMMODITY_H */ diff --git a/tests/corelib/numerics/CommodityAmount.cc b/tests/corelib/numerics/CommodityAmount.cc index 0eca3140..c41b33d4 100644 --- a/tests/corelib/numerics/CommodityAmount.cc +++ b/tests/corelib/numerics/CommodityAmount.cc @@ -665,26 +665,6 @@ void CommodityAmountTestCase::testAbs() assertValid(x2); } -void CommodityAmountTestCase::testPriceHistory() -{ - // jww (2007-04-17): tbd -} - -void CommodityAmountTestCase::testLots() -{ - // jww (2007-04-17): tbd -} - -void CommodityAmountTestCase::testScalingBase() -{ - // jww (2007-04-17): tbd -} - -void CommodityAmountTestCase::testReduction() -{ - // jww (2007-04-17): tbd -} - void CommodityAmountTestCase::testPrinting() { amount_t x0; diff --git a/tests/corelib/numerics/CommodityAmount.h b/tests/corelib/numerics/CommodityAmount.h index 70d55de4..5ffa7810 100644 --- a/tests/corelib/numerics/CommodityAmount.h +++ b/tests/corelib/numerics/CommodityAmount.h @@ -24,10 +24,6 @@ class CommodityAmountTestCase : public CPPUNIT_NS::TestCase CPPUNIT_TEST(testSign); CPPUNIT_TEST(testAbs); CPPUNIT_TEST(testPrinting); - CPPUNIT_TEST(testPriceHistory); - CPPUNIT_TEST(testLots); - CPPUNIT_TEST(testScalingBase); - CPPUNIT_TEST(testReduction); CPPUNIT_TEST_SUITE_END(); @@ -55,10 +51,6 @@ public: void testSign(); void testAbs(); void testPrinting(); - void testPriceHistory(); - void testLots(); - void testScalingBase(); - void testReduction(); private: CommodityAmountTestCase(const CommodityAmountTestCase ©); |