summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/mymoneyfiletest.h
blob: 917f1f4b31ffe245a7fb782d0f65b590e4f297f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/***************************************************************************
                          mymoneyfiletest.h
                          -------------------
    copyright            : (C) 2002 by Thomas Baumgart
    email                : ipwizard@users.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef __MYMONEYFILETEST_H__
#define __MYMONEYFILETEST_H__

#include <cppunit/extensions/HelperMacros.h>
#include "autotest.h"

#define private public
#define protected public
#include "mymoneyfile.h"
#include "storage/mymoneyseqaccessmgr.h"
#undef private
#undef protected

class MyMoneyFileTest : public CppUnit::TestFixture  {
        CPPUNIT_TEST_SUITE(MyMoneyFileTest);
	CPPUNIT_TEST(testEmptyConstructor);
	CPPUNIT_TEST(testAddOneInstitution);
	CPPUNIT_TEST(testAddTwoInstitutions);
	CPPUNIT_TEST(testInstitutionRetrieval);
	CPPUNIT_TEST(testRemoveInstitution);
	CPPUNIT_TEST(testInstitutionListRetrieval);
	CPPUNIT_TEST(testInstitutionModify);
	CPPUNIT_TEST(testSetFunctions);
	CPPUNIT_TEST(testAddAccounts);
	CPPUNIT_TEST(testModifyAccount);
	CPPUNIT_TEST(testModifyStdAccount);
	CPPUNIT_TEST(testReparentAccount);
	CPPUNIT_TEST(testRemoveAccount);
	CPPUNIT_TEST(testRemoveAccountTree);
	CPPUNIT_TEST(testAccountListRetrieval);
	CPPUNIT_TEST(testAddTransaction);
	CPPUNIT_TEST(testHasActiveSplits);
	CPPUNIT_TEST(testIsStandardAccount);
	CPPUNIT_TEST(testModifyTransactionSimple);
	CPPUNIT_TEST(testModifyTransactionNewPostDate);
	CPPUNIT_TEST(testModifyTransactionNewAccount);
	CPPUNIT_TEST(testRemoveTransaction);
	CPPUNIT_TEST(testBalanceTotal);
	CPPUNIT_TEST(testSetAccountName);
	CPPUNIT_TEST(testAddPayee);
	CPPUNIT_TEST(testModifyPayee);
	CPPUNIT_TEST(testRemovePayee);
	CPPUNIT_TEST(testAddTransactionStd);
	CPPUNIT_TEST(testAttachStorage);
	CPPUNIT_TEST(testAccount2Category);
	CPPUNIT_TEST(testCategory2Account);
	CPPUNIT_TEST(testAttachedStorage);
	CPPUNIT_TEST(testHasAccount);
	CPPUNIT_TEST(testAddEquityAccount);
	CPPUNIT_TEST(testReparentEquity);
	CPPUNIT_TEST(testBaseCurrency);
	CPPUNIT_TEST(testOpeningBalanceNoBase);
	CPPUNIT_TEST(testOpeningBalance);
#if 0
	CPPUNIT_TEST(testMoveSplits);
#endif
	CPPUNIT_TEST_SUITE_END();
protected:
	MyMoneyFile	*m;
	MyMoneySeqAccessMgr*	storage;
	MyMoneyAccount  m_inv;

public:
	MyMoneyFileTest ();

	void setUp ();
	void tearDown ();
	void testEmptyConstructor();
	void testAddOneInstitution();
	void testAddTwoInstitutions();
	void testRemoveInstitution();
	void testInstitutionRetrieval ();
	void testInstitutionListRetrieval ();
	void testInstitutionModify();
	void testSetFunctions();
	void testAddAccounts();
	void testModifyAccount();
	void testModifyStdAccount();
	void testReparentAccount();
	void testRemoveAccount();
	void testRemoveAccountTree();
	void testAccountListRetrieval ();
	void testAddTransaction ();
	void testIsStandardAccount();
	void testHasActiveSplits();
	void testModifyTransactionSimple();
	void testModifyTransactionNewPostDate();
	void testModifyTransactionNewAccount();
	void testRemoveTransaction ();
	void testBalanceTotal();
	void testSetAccountName();
	void testAddPayee();
	void testModifyPayee();
	void testRemovePayee();
	void testAddTransactionStd();
	void testAttachStorage();
	void testAccount2Category();
	void testCategory2Account();
	void testAttachedStorage();
	void testHasAccount();
	void testAddEquityAccount();
	void testReparentEquity();
	void testReparentEquity(TQValueList<MyMoneyAccount::accountTypeE>& list, MyMoneyAccount& parent);
	void testBaseCurrency();
	void testOpeningBalanceNoBase();
	void testOpeningBalance();

private:
	void testRemoveStdAccount(const MyMoneyAccount& acc);
};

#endif