Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/tests/mymoneyforecast-test.cpp
Context not available. | |||||
28 | #include "mymoneystoragexml.h" | 28 | #include "mymoneystoragexml.h" | ||
---|---|---|---|---|---|
29 | #include "reportstestcommon.h" | 29 | #include "reportstestcommon.h" | ||
30 | 30 | | |||
31 | #include "mymoneyenums.h" | ||||
32 | | ||||
33 | using namespace eMyMoney; | ||||
31 | using namespace test; | 34 | using namespace test; | ||
32 | 35 | | |||
33 | QTEST_GUILESS_MAIN(MyMoneyForecastTest) | 36 | QTEST_GUILESS_MAIN(MyMoneyForecastTest) | ||
Context not available. | |||||
66 | acLiability = (MyMoneyFile::instance()->liability().id()); | 69 | acLiability = (MyMoneyFile::instance()->liability().id()); | ||
67 | acExpense = (MyMoneyFile::instance()->expense().id()); | 70 | acExpense = (MyMoneyFile::instance()->expense().id()); | ||
68 | acIncome = (MyMoneyFile::instance()->income().id()); | 71 | acIncome = (MyMoneyFile::instance()->income().id()); | ||
69 | acChecking = makeAccount(QString("Checking Account"), MyMoneyAccount::Checkings, moCheckingOpen, QDate(2004, 5, 15), acAsset, "USD"); | 72 | acChecking = makeAccount(QString("Checking Account"), Account::Checkings, moCheckingOpen, QDate(2004, 5, 15), acAsset, "USD"); | ||
70 | acCredit = makeAccount(QString("Credit Card"), MyMoneyAccount::CreditCard, moCreditOpen, QDate(2004, 7, 15), acLiability, "USD"); | 73 | acCredit = makeAccount(QString("Credit Card"), Account::CreditCard, moCreditOpen, QDate(2004, 7, 15), acLiability, "USD"); | ||
71 | acSolo = makeAccount(QString("Solo"), MyMoneyAccount::Expense, MyMoneyMoney(), QDate(2004, 1, 11), acExpense, "USD"); | 74 | acSolo = makeAccount(QString("Solo"), Account::Expense, MyMoneyMoney(), QDate(2004, 1, 11), acExpense, "USD"); | ||
72 | acParent = makeAccount(QString("Parent"), MyMoneyAccount::Expense, MyMoneyMoney(), QDate(2004, 1, 11), acExpense, "USD"); | 75 | acParent = makeAccount(QString("Parent"), Account::Expense, MyMoneyMoney(), QDate(2004, 1, 11), acExpense, "USD"); | ||
73 | acChild = makeAccount(QString("Child"), MyMoneyAccount::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acParent, "USD"); | 76 | acChild = makeAccount(QString("Child"), Account::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acParent, "USD"); | ||
74 | acForeign = makeAccount(QString("Foreign"), MyMoneyAccount::Expense, MyMoneyMoney(), QDate(2004, 1, 11), acExpense, "USD"); | 77 | acForeign = makeAccount(QString("Foreign"), Account::Expense, MyMoneyMoney(), QDate(2004, 1, 11), acExpense, "USD"); | ||
75 | acInvestment = makeAccount("Investment", MyMoneyAccount::Investment, moZero, QDate(2004, 1, 1), acAsset, "USD"); | 78 | acInvestment = makeAccount("Investment", Account::Investment, moZero, QDate(2004, 1, 1), acAsset, "USD"); | ||
76 | 79 | | |||
77 | acSecondChild = makeAccount(QString("Second Child"), MyMoneyAccount::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acParent, "USD"); | 80 | acSecondChild = makeAccount(QString("Second Child"), Account::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acParent, "USD"); | ||
78 | acGrandChild1 = makeAccount(QString("Grand Child 1"), MyMoneyAccount::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acChild, "USD"); | 81 | acGrandChild1 = makeAccount(QString("Grand Child 1"), Account::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acChild, "USD"); | ||
79 | acGrandChild2 = makeAccount(QString("Grand Child 2"), MyMoneyAccount::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acChild, "USD"); | 82 | acGrandChild2 = makeAccount(QString("Grand Child 2"), Account::Expense, MyMoneyMoney(), QDate(2004, 2, 11), acChild, "USD"); | ||
80 | 83 | | |||
81 | //this account added to have an account to test opening date calculations | 84 | //this account added to have an account to test opening date calculations | ||
82 | acCash = makeAccount(QString("Cash"), MyMoneyAccount::Cash, moCreditOpen, QDate::currentDate().addDays(-2), acAsset, "USD"); | 85 | acCash = makeAccount(QString("Cash"), Account::Cash, moCreditOpen, QDate::currentDate().addDays(-2), acAsset, "USD"); | ||
83 | 86 | | |||
84 | 87 | | |||
85 | MyMoneyInstitution i("Bank of the World", "", "", "", "", "", ""); | 88 | MyMoneyInstitution i("Bank of the World", "", "", "", "", "", ""); | ||
Context not available. | |||||
386 | 389 | | |||
387 | MyMoneyFileTransaction ft; | 390 | MyMoneyFileTransaction ft; | ||
388 | MyMoneySchedule sch("A Name", | 391 | MyMoneySchedule sch("A Name", | ||
389 | MyMoneySchedule::TYPE_BILL, | 392 | Schedule::Type::Bill, | ||
390 | MyMoneySchedule::OCCUR_WEEKLY, 1, | 393 | Schedule::Occurrence::Weekly, 1, | ||
391 | MyMoneySchedule::STYPE_DIRECTDEBIT, | 394 | Schedule::PaymentType::DirectDebit, | ||
392 | QDate::currentDate().addDays(1), | 395 | QDate::currentDate().addDays(1), | ||
393 | QDate(), | 396 | QDate(), | ||
394 | true, | 397 | true, | ||
Context not available. | |||||
428 | 431 | | |||
429 | MyMoneyFileTransaction ft3; | 432 | MyMoneyFileTransaction ft3; | ||
430 | MyMoneySchedule sch3("A Name1", | 433 | MyMoneySchedule sch3("A Name1", | ||
431 | MyMoneySchedule::TYPE_BILL, | 434 | Schedule::Type::Bill, | ||
432 | MyMoneySchedule::OCCUR_WEEKLY, 1, | 435 | Schedule::Occurrence::Weekly, 1, | ||
433 | MyMoneySchedule::STYPE_DIRECTDEBIT, | 436 | Schedule::PaymentType::DirectDebit, | ||
434 | QDate::currentDate().addDays(5), | 437 | QDate::currentDate().addDays(5), | ||
435 | QDate(), | 438 | QDate(), | ||
436 | true, | 439 | true, | ||
Context not available. | |||||
475 | 478 | | |||
476 | MyMoneyFileTransaction ft2; | 479 | MyMoneyFileTransaction ft2; | ||
477 | MyMoneySchedule sch2("A Name2", | 480 | MyMoneySchedule sch2("A Name2", | ||
478 | MyMoneySchedule::TYPE_BILL, | 481 | Schedule::Type::Bill, | ||
479 | MyMoneySchedule::OCCUR_WEEKLY, 1, | 482 | Schedule::Occurrence::Weekly, 1, | ||
480 | MyMoneySchedule::STYPE_DIRECTDEBIT, | 483 | Schedule::PaymentType::DirectDebit, | ||
481 | QDate::currentDate().addDays(2), | 484 | QDate::currentDate().addDays(2), | ||
482 | QDate(), | 485 | QDate(), | ||
483 | true, | 486 | true, | ||
Context not available. | |||||
902 | 905 | | |||
903 | MyMoneyFileTransaction ft; | 906 | MyMoneyFileTransaction ft; | ||
904 | MyMoneySchedule sch("A Name", | 907 | MyMoneySchedule sch("A Name", | ||
905 | MyMoneySchedule::TYPE_BILL, | 908 | Schedule::Type::Bill, | ||
906 | MyMoneySchedule::OCCUR_MONTHLY, 1, | 909 | Schedule::Occurrence::Monthly, 1, | ||
907 | MyMoneySchedule::STYPE_DIRECTDEBIT, | 910 | Schedule::PaymentType::DirectDebit, | ||
908 | QDate::currentDate(), | 911 | QDate::currentDate(), | ||
909 | QDate(), | 912 | QDate(), | ||
910 | true, | 913 | true, | ||
Context not available. |