From 64c8229dd91312c323fbe79d914e773ce5fc32ef Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Apr 2007 11:17:30 +0000 Subject: Miscellaneous changes --- tests/corelib/numerics/BasicAmount.h | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/corelib/numerics/BasicAmount.h (limited to 'tests/corelib/numerics/BasicAmount.h') diff --git a/tests/corelib/numerics/BasicAmount.h b/tests/corelib/numerics/BasicAmount.h new file mode 100644 index 00000000..6e2f021e --- /dev/null +++ b/tests/corelib/numerics/BasicAmount.h @@ -0,0 +1,50 @@ +#ifndef _BASICAMOUNTTEST_H +#define _BASICAMOUNTTEST_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_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(); + +private: + BasicAmountTestCase(const BasicAmountTestCase ©); + void operator=(const BasicAmountTestCase ©); +}; + +#endif /* _BASICAMOUNTTEST_H */ -- cgit v1.2.3