File indexing completed on 2024-05-19 16:18:18
0001 /*************************************************************************** 0002 * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr 0003 * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 ***************************************************************************/ 0006 /** @file 0007 * This file is a test script. 0008 * 0009 * @author Stephane MANKOWSKI / Guillaume DE BURE 0010 */ 0011 #include "skgtestmacro.h" 0012 #include "skgbankincludes.h" 0013 #include "skgimportexportmanager.h" 0014 0015 /** 0016 * The main function of the unit test 0017 * @param argc the number of arguments 0018 * @param argv the list of arguments 0019 */ 0020 int main(int argc, char** argv) 0021 { 0022 Q_UNUSED(argc) 0023 Q_UNUSED(argv) 0024 0025 // Init test 0026 SKGINITTEST(true) 0027 0028 QDate d(1970, 1, 1); 0029 0030 { 0031 // Test import QIF 1 0032 SKGDocumentBank document1; 0033 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0034 SKGBankObject bank(&document1); 0035 SKGAccountObject account; 0036 SKGUnitObject unit_euro(&document1); 0037 SKGError err; 0038 { 0039 // Scope of the transaction 0040 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_INIT"), err) 0041 SKGImportExportManager impmissing(&document1, QUrl::fromLocalFile(QStringLiteral("missingfile.qif"))); 0042 SKGTESTERROR(QStringLiteral("imp1.importFile"), impmissing.importFile(), false) 0043 impmissing.getParameterDefaultValue(QStringLiteral("mapping_date")); 0044 0045 // Creation bank 0046 SKGTESTERROR(QStringLiteral("BANK:setName"), bank.setName(QStringLiteral("CREDIT COOP")), true) 0047 SKGTESTERROR(QStringLiteral("BANK:setNumber"), bank.setNumber(QStringLiteral("0003")), true) 0048 SKGTESTERROR(QStringLiteral("BANK:save"), bank.save(), true) 0049 0050 // Creation account 0051 SKGTESTERROR(QStringLiteral("BANK:addAccount"), bank.addAccount(account), true) 0052 SKGTESTERROR(QStringLiteral("ACCOUNT:setName"), account.setName(QStringLiteral("Courant steph")), true) 0053 SKGTESTERROR(QStringLiteral("ACCOUNT:setNumber"), account.setNumber(QStringLiteral("12345P")), true) 0054 SKGTESTERROR(QStringLiteral("ACCOUNT:setAgencyNumber"), account.setAgencyNumber(QStringLiteral("98765")), true) 0055 SKGTESTERROR(QStringLiteral("ACCOUNT:setAgencyNumber"), account.setAgencyAddress(QStringLiteral("10 rue Dupon, 31000 TOULOUSE")), true) 0056 SKGTESTERROR(QStringLiteral("ACCOUNT:save"), account.save(), true) 0057 0058 // Creation unit 0059 SKGTESTERROR(QStringLiteral("UNIT:setName"), unit_euro.setName(QStringLiteral("euro")), true) 0060 SKGTESTERROR(QStringLiteral("UNIT:save"), unit_euro.save(), true) 0061 0062 // Creation unitvalue 0063 SKGUnitValueObject unit_euro_val1; 0064 SKGTESTERROR(QStringLiteral("UNIT:addUnitValue"), unit_euro.addUnitValue(unit_euro_val1), true) 0065 SKGTESTERROR(QStringLiteral("UNITVALUE:setQuantity"), unit_euro_val1.setQuantity(1), true) 0066 SKGTESTERROR(QStringLiteral("UNITVALUE:setDate"), unit_euro_val1.setDate(d), true) 0067 SKGTESTERROR(QStringLiteral("UNITVALUE:save"), unit_euro_val1.save(), true) 0068 } 0069 { 0070 // Scope of the transaction 0071 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_BP_QIF"), err) 0072 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/ref.qif")); 0073 SKGTESTERROR(QStringLiteral("QIF.setDefaultAccount"), imp1.setDefaultAccount(&account), true) 0074 SKGTESTERROR(QStringLiteral("QIF.setDefaultUnit"), imp1.setDefaultUnit(&unit_euro), true) 0075 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0076 } 0077 0078 SKGTESTERROR(QStringLiteral("ACCOUNT:load"), account.load(), true) 0079 SKGTEST(QStringLiteral("ACCOUNT:getCurrentAmount"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-935")) 0080 0081 { 0082 // Scope of the transaction 0083 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_BP_QIF"), err) 0084 SKGImportExportManager imp1(&document1); 0085 SKGTESTERROR(QStringLiteral("QIF.cleanBankImport"), imp1.cleanBankImport(), true) 0086 int out = 0; 0087 SKGTESTERROR(QStringLiteral("QIF.findAndGroupTransfers"), imp1.findAndGroupTransfers(out), true) 0088 0089 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/ref.qif")); 0090 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0091 } 0092 0093 SKGTESTERROR(QStringLiteral("ACCOUNT:load"), account.load(), true) 0094 SKGTEST(QStringLiteral("ACCOUNT:getCurrentAmount"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-935")) 0095 } 0096 0097 { 0098 // Test import QIF 2 0099 SKGDocumentBank document1; 0100 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0101 SKGBankObject bank(&document1); 0102 SKGAccountObject account; 0103 SKGUnitObject unit_euro(&document1); 0104 SKGError err; 0105 { 0106 // Scope of the transaction 0107 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_INIT"), err) 0108 0109 // Creation bank 0110 SKGTESTERROR(QStringLiteral("BANK:setName"), bank.setName(QStringLiteral("CREDIT COOP")), true) 0111 SKGTESTERROR(QStringLiteral("BANK:save"), bank.save(), true) 0112 0113 // Creation account 0114 SKGTESTERROR(QStringLiteral("BANK:addAccount"), bank.addAccount(account), true) 0115 SKGTESTERROR(QStringLiteral("ACCOUNT:setName"), account.setName(QStringLiteral("Courant Guillaume")), true) 0116 SKGTESTERROR(QStringLiteral("ACCOUNT:setNumber"), account.setNumber(QStringLiteral("98765A")), true) 0117 SKGTESTERROR(QStringLiteral("ACCOUNT:save"), account.save(), true) 0118 0119 // Creation unit 0120 SKGTESTERROR(QStringLiteral("UNIT:setName"), unit_euro.setName(QStringLiteral("euro")), true) 0121 SKGTESTERROR(QStringLiteral("UNIT:save"), unit_euro.save(), true) 0122 0123 // Creation unitvalue 0124 SKGUnitValueObject unit_euro_val1; 0125 SKGTESTERROR(QStringLiteral("UNIT:addUnitValue"), unit_euro.addUnitValue(unit_euro_val1), true) 0126 SKGTESTERROR(QStringLiteral("UNITVALUE:setQuantity"), unit_euro_val1.setQuantity(1), true) 0127 SKGTESTERROR(QStringLiteral("UNITVALUE:setDate"), unit_euro_val1.setDate(d), true) 0128 SKGTESTERROR(QStringLiteral("UNITVALUE:save"), unit_euro_val1.save(), true) 0129 } 0130 { 0131 // Scope of the transaction 0132 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_BP_QIF"), err) 0133 0134 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/E0269787.qif")); 0135 SKGTESTERROR(QStringLiteral("QIF.setDefaultAccount"), imp1.setDefaultAccount(&account), true) 0136 SKGTESTERROR(QStringLiteral("QIF.setDefaultUnit"), imp1.setDefaultUnit(&unit_euro), true) 0137 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0138 SKGTESTERROR(QStringLiteral("QIF.cleanBankImport"), imp1.cleanBankImport(), true) 0139 int out = 0; 0140 SKGTESTERROR(QStringLiteral("QIF.findAndGroupTransfers"), imp1.findAndGroupTransfers(out), true) 0141 0142 0143 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/E0269787.qif")); 0144 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0145 } 0146 0147 SKGTESTERROR(QStringLiteral("ACCOUNT:load"), account.load(), true) 0148 SKGTEST(QStringLiteral("ACCOUNT:getCurrentAmount"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-1684.58")) 0149 0150 // Check import with account retrieved from file 0151 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0152 unit_euro = SKGUnitObject(&document1); 0153 { 0154 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_INIT"), err) 0155 // Creation unit 0156 SKGTESTERROR(QStringLiteral("UNIT:setName"), unit_euro.setName(QStringLiteral("euro")), true) 0157 SKGTESTERROR(QStringLiteral("UNIT:save"), unit_euro.save(), true) 0158 0159 // Creation unitvalue 0160 SKGUnitValueObject unit_euro_val1; 0161 SKGTESTERROR(QStringLiteral("UNIT:addUnitValue"), unit_euro.addUnitValue(unit_euro_val1), true) 0162 SKGTESTERROR(QStringLiteral("UNITVALUE:setQuantity"), unit_euro_val1.setQuantity(1), true) 0163 SKGTESTERROR(QStringLiteral("UNITVALUE:setDate"), unit_euro_val1.setDate(d), true) 0164 SKGTESTERROR(QStringLiteral("UNITVALUE:save"), unit_euro_val1.save(), true) 0165 0166 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/E0269787.qif")); 0167 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0168 SKGTESTERROR(QStringLiteral("QIF.cleanBankImport"), imp1.cleanBankImport(), true) 0169 int out = 0; 0170 SKGTESTERROR(QStringLiteral("QIF.findAndGroupTransfers"), imp1.findAndGroupTransfers(out), true) 0171 0172 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/E0269787_bis.qif")); 0173 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0174 } 0175 0176 // Check multi import 0177 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) { 0178 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/ref.qif")); 0179 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0180 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) // Double import 0181 SKGTESTERROR(QStringLiteral("QIF.cleanBankImport"), imp1.cleanBankImport(), true) 0182 int out = 0; 0183 SKGTESTERROR(QStringLiteral("QIF.findAndGroupTransfers"), imp1.findAndGroupTransfers(out), true) 0184 } 0185 0186 // Check import with account retrieved from files 0187 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) { 0188 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/ref.qif")); 0189 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0190 SKGImportExportManager imp2(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/E0269787.qif")); 0191 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp2.importFile(), true) 0192 SKGTESTERROR(QStringLiteral("QIF.cleanBankImport"), imp1.cleanBankImport(), true) 0193 int out = 0; 0194 SKGTESTERROR(QStringLiteral("QIF.findAndGroupTransfers"), imp1.findAndGroupTransfers(out), true) 0195 0196 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/E0269787_ref.qif")); 0197 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0198 } 0199 0200 // Check import qif multi accounts 0201 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) { 0202 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/E0269787_ref.qif")); 0203 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0204 SKGTESTERROR(QStringLiteral("QIF.cleanBankImport"), imp1.cleanBankImport(), true) 0205 int out = 0; 0206 SKGTESTERROR(QStringLiteral("QIF.findAndGroupTransfers"), imp1.findAndGroupTransfers(out), true) 0207 QStringList oResult; 0208 SKGTESTERROR(QStringLiteral("ACCOUNT:getDistinctValues"), document1.getDistinctValues(QStringLiteral("account"), QStringLiteral("t_name"), oResult), true) 0209 SKGTEST(QStringLiteral("ACCOUNT:oResult.size"), oResult.size(), 3) 0210 } 0211 } 0212 0213 { 0214 // Test import QIF 2 0215 SKGDocumentBank document1; 0216 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0217 SKGBankObject bank(&document1); 0218 SKGAccountObject account; 0219 SKGUnitObject unit_euro(&document1); 0220 SKGError err; 0221 { 0222 // Scope of the transaction 0223 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_INIT"), err) 0224 0225 // Creation bank 0226 SKGTESTERROR(QStringLiteral("BANK:setName"), bank.setName(QStringLiteral("ING")), true) 0227 SKGTESTERROR(QStringLiteral("BANK:save"), bank.save(), true) 0228 0229 // Creation account 0230 SKGTESTERROR(QStringLiteral("BANK:addAccount"), bank.addAccount(account), true) 0231 SKGTESTERROR(QStringLiteral("ACCOUNT:setName"), account.setName(QStringLiteral("ING")), true) 0232 SKGTESTERROR(QStringLiteral("ACCOUNT:setNumber"), account.setNumber(QStringLiteral("ING")), true) 0233 SKGTESTERROR(QStringLiteral("ACCOUNT:save"), account.save(), true) 0234 0235 // Creation unit 0236 SKGTESTERROR(QStringLiteral("UNIT:setName"), unit_euro.setName(QStringLiteral("euro")), true) 0237 SKGTESTERROR(QStringLiteral("UNIT:save"), unit_euro.save(), true) 0238 0239 // Creation unitvalue 0240 SKGUnitValueObject unit_euro_val1; 0241 SKGTESTERROR(QStringLiteral("UNIT:addUnitValue"), unit_euro.addUnitValue(unit_euro_val1), true) 0242 SKGTESTERROR(QStringLiteral("UNITVALUE:setQuantity"), unit_euro_val1.setQuantity(1), true) 0243 SKGTESTERROR(QStringLiteral("UNITVALUE:setDate"), unit_euro_val1.setDate(d), true) 0244 SKGTESTERROR(QStringLiteral("UNITVALUE:save"), unit_euro_val1.save(), true) 0245 } 0246 { 0247 // Scope of the transaction 0248 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_ING_QIF"), err) 0249 0250 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/ing.qif")); 0251 SKGTESTERROR(QStringLiteral("QIF.setDefaultAccount"), imp1.setDefaultAccount(&account), true) 0252 SKGTESTERROR(QStringLiteral("QIF.setDefaultUnit"), imp1.setDefaultUnit(&unit_euro), true) 0253 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0254 SKGTESTERROR(QStringLiteral("QIF.cleanBankImport"), imp1.cleanBankImport(), true) 0255 int out = 0; 0256 SKGTESTERROR(QStringLiteral("QIF.findAndGroupTransfers"), imp1.findAndGroupTransfers(out), true) 0257 0258 0259 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/ing.qif")); 0260 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0261 } 0262 } 0263 0264 { 0265 // Test import QIF MOTO 0266 SKGDocumentBank document1; 0267 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0268 SKGError err; 0269 { 0270 // Scope of the transaction 0271 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_ING_QIF"), err) 0272 0273 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/moto.qif")); 0274 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0275 } 0276 0277 { 0278 SKGAccountObject account(&document1); 0279 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("ACTIF Moto")), true) 0280 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0281 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("26198.77")) 0282 } 0283 } 0284 0285 { 0286 // Test import QIF MOTO with euro and franc 0287 SKGDocumentBank document1; 0288 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0289 SKGError err; 0290 { 0291 // Scope of the transaction 0292 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_INIT"), err) 0293 0294 SKGUnitObject unit; 0295 SKGTESTERROR(QStringLiteral("SKGUnitObject::createCurrencyUnit"), SKGUnitObject::createCurrencyUnit(&document1, QStringLiteral("EUR"), unit), true) 0296 SKGTESTERROR(QStringLiteral("SKGUnitObject::createCurrencyUnit"), SKGUnitObject::createCurrencyUnit(&document1, QStringLiteral("FRF"), unit), true) 0297 SKGTESTERROR(QStringLiteral("FRANC.addOrModifyUnitValue"), document1.addOrModifyUnitValue(QStringLiteral("French Franc (FRF)"), QDate(1963, 1, 1), 1.0 / 6.55957), true) 0298 } 0299 { 0300 // Scope of the transaction 0301 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_ING_QIF"), err) 0302 0303 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/moto.qif")); 0304 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0305 } 0306 0307 { 0308 SKGAccountObject account(&document1); 0309 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("ACTIF Moto")), true) 0310 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0311 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(static_cast<int>(account.getCurrentAmount())), QStringLiteral("5009")) 0312 } 0313 } 0314 0315 { 0316 // Test import QIF KMM 0317 SKGDocumentBank document1; 0318 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0319 SKGError err; 0320 { 0321 // Scope of the transaction 0322 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_KMM_QIF"), err) 0323 0324 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/kmm-without-category.qif")); 0325 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0326 } 0327 0328 { 0329 SKGAccountObject account(&document1); 0330 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("CCP")), true) 0331 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0332 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-52.36")) 0333 } 0334 } 0335 0336 { 0337 // Test import QIF KMM with category 0338 SKGDocumentBank document1; 0339 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0340 SKGError err; 0341 { 0342 // Scope of the transaction 0343 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_KMM_QIF"), err) 0344 0345 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/kmm-with-category.qif")); 0346 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0347 } 0348 0349 { 0350 SKGAccountObject account(&document1); 0351 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("CCP")), true) 0352 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0353 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-52.36")) 0354 } 0355 } 0356 0357 { 0358 // Test import QIF REMI in double to check merge 0359 SKGDocumentBank document1; 0360 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0361 SKGError err; 0362 { 0363 // Scope of the transaction 0364 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_REMI_QIF"), err) 0365 0366 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/remi_2.qif")); 0367 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0368 } 0369 { 0370 // Scope of the transaction 0371 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_REMI_QIF"), err) 0372 0373 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/remi_2.qif")); 0374 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0375 } 0376 { 0377 SKGAccountObject account(&document1); 0378 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("remi 2")), true) 0379 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0380 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-1208.63")) 0381 } 0382 } 0383 0384 { 0385 // Test import QIF REMI in double to check merge 0386 SKGDocumentBank document1; 0387 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0388 SKGError err; 0389 { 0390 // Scope of the transaction 0391 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_DOUBLE"), err) 0392 0393 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/double.qif")); 0394 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0395 } 0396 { 0397 SKGAccountObject account(&document1); 0398 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("double")), true) 0399 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0400 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-243")) 0401 } 0402 } 0403 0404 { 0405 // Test import bug GNUCash 350286 0406 SKGDocumentBank document1; 0407 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0408 SKGError err; 0409 { 0410 // Scope of the transaction 0411 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0412 0413 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/350286.qif")); 0414 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0415 } 0416 0417 { 0418 SKGAccountObject account(&document1); 0419 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("350286")), true) 0420 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0421 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("1057.37")) 0422 } 0423 } 0424 0425 { 0426 // Test import bug GNUCash 393596 0427 SKGDocumentBank document1; 0428 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0429 SKGError err; 0430 { 0431 // Scope of the transaction 0432 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0433 0434 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/393596.qif")); 0435 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0436 } 0437 0438 { 0439 SKGAccountObject account(&document1); 0440 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("393596")), true) 0441 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0442 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("12.34")) 0443 } 0444 } 0445 0446 { 0447 // Test import bug GNUCash 503166 0448 SKGDocumentBank document1; 0449 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0450 SKGError err; 0451 { 0452 // Scope of the transaction 0453 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0454 0455 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/503166.qif")); 0456 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0457 } 0458 0459 { 0460 SKGAccountObject account(&document1); 0461 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("My Investments")), true) 0462 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0463 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("20")) 0464 } 0465 } 0466 0467 { 0468 // Test import bug GNUCash 392707 0469 SKGDocumentBank document1; 0470 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0471 SKGError err; 0472 { 0473 // Scope of the transaction 0474 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0475 0476 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/392707.qif")); 0477 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0478 } 0479 0480 { 0481 SKGAccountObject account(&document1); 0482 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("392707")), true) 0483 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0484 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("1219.06")) 0485 } 0486 } 0487 0488 { 0489 // Test import bug GNUCash 373584 0490 SKGDocumentBank document1; 0491 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0492 SKGError err; 0493 { 0494 // Scope of the transaction 0495 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0496 0497 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/373584.qif")); 0498 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0499 } 0500 0501 { 0502 SKGAccountObject account(&document1); 0503 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("My Investments")), true) 0504 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0505 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("1000000")) 0506 } 0507 } 0508 0509 { 0510 // Test import bug 199818 0511 SKGDocumentBank document1; 0512 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0513 SKGError err; 0514 { 0515 // Scope of the transaction 0516 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0517 0518 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/199818.qif")); 0519 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0520 } 0521 0522 { 0523 SKGAccountObject account(&document1); 0524 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("199818")), true) 0525 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0526 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-345.64")) 0527 } 0528 } 0529 0530 { 0531 // Test import bug 201316 0532 SKGDocumentBank document1; 0533 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0534 SKGError err; 0535 { 0536 // Scope of the transaction 0537 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0538 0539 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/201316.qif")); 0540 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0541 } 0542 0543 { 0544 SKGStringListList listTmp; 0545 SKGTESTERROR(QStringLiteral("QIF.executeSelectSqliteOrder"), document1.executeSelectSqliteOrder( 0546 QStringLiteral("SELECT TOTAL(f_CURRENTAMOUNT),t_status FROM v_operation_display GROUP BY t_status ORDER BY t_status"), listTmp), true); 0547 SKGTEST(QStringLiteral("QIF:listTmp.count"), listTmp.count(), 4) 0548 if (listTmp.count() == 4) { 0549 SKGTEST(QStringLiteral("QIF:listTmp.at(1).at(0)"), listTmp.at(1).at(0), QStringLiteral("-10")) 0550 SKGTEST(QStringLiteral("QIF:listTmp.at(2).at(0)"), listTmp.at(2).at(0), QStringLiteral("-100")) 0551 SKGTEST(QStringLiteral("QIF:listTmp.at(3).at(0)"), listTmp.at(3).at(0), QStringLiteral("-1000")) 0552 } 0553 } 0554 } 0555 0556 { 0557 // Test import bug 201451 0558 SKGDocumentBank document1; 0559 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0560 SKGError err; 0561 { 0562 // Scope of the transaction 0563 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0564 0565 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/201451.qif")); 0566 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0567 } 0568 0569 { 0570 SKGAccountObject account(&document1); 0571 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("liability")), true) 0572 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0573 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-123.45")) 0574 } 0575 } 0576 0577 { 0578 // Test import bug 214809 0579 SKGDocumentBank document1; 0580 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0581 SKGError err; 0582 { 0583 // Scope of the transaction 0584 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0585 0586 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/BNP_CC_virement.qif")); 0587 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0588 } 0589 0590 { 0591 SKGAccountObject account(&document1); 0592 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("BNP CC")), true) 0593 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0594 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("696.64")) 0595 } 0596 { 0597 SKGAccountObject account(&document1); 0598 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("BNP CEL")), true) 0599 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0600 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("500")) 0601 } 0602 } 0603 0604 { 0605 // Test import bug 214851 0606 SKGDocumentBank document1; 0607 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0608 SKGError err; 0609 { 0610 // Scope of the transaction 0611 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0612 0613 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/Fortuneo PEA (Caisse).qif")); 0614 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0615 0616 SKGImportExportManager imp2(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/Fortuneo PEA.qif")); 0617 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp2.importFile(), true) 0618 } 0619 0620 { 0621 SKGAccountObject account(&document1); 0622 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("BNP CC")), true) 0623 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0624 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-3604")) 0625 } 0626 { 0627 SKGAccountObject account(&document1); 0628 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("Fortuneo PEA")), true) 0629 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0630 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("86.29")) 0631 } 0632 { 0633 SKGAccountObject account(&document1); 0634 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("Fortuneo PEA (Caisse)")), true) 0635 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0636 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("10319.5")) 0637 } 0638 { 0639 SKGAccountObject account(&document1); 0640 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("Fortuneo Titres (Caisse)")), true) 0641 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0642 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-6700")) 0643 } 0644 } 0645 0646 { 0647 // Test import bug 215620 0648 SKGDocumentBank document1; 0649 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0650 SKGError err; 0651 { 0652 // Scope of the transaction 0653 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0654 0655 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/Cortal PEA.qif")); 0656 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0657 0658 SKGImportExportManager imp2(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/EADS.qif")); 0659 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp2.importFile(), true) 0660 } 0661 } 0662 0663 { 0664 // Test import bug 216520 0665 SKGDocumentBank document1; 0666 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0667 SKGError err; 0668 { 0669 // Scope of the transaction 0670 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0671 0672 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/216520.qif")); 0673 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0674 } 0675 { 0676 SKGAccountObject account(&document1); 0677 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("BNP CC")), true) 0678 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0679 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("11196.64")) 0680 } 0681 } 0682 0683 { 0684 // Test import investment 0685 SKGDocumentBank document1; 0686 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0687 SKGError err; 0688 { 0689 // Scope of the transaction 0690 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_INIT"), err) 0691 0692 SKGUnitObject unit; 0693 SKGTESTERROR(QStringLiteral("EUR.setName"), SKGUnitObject::createCurrencyUnit(&document1, QStringLiteral("Euro (EUR)"), unit), true) 0694 } 0695 { 0696 // Scope of the transaction 0697 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0698 0699 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/exp_inv.qif")); 0700 imp1.setCodec(QStringLiteral("UTF-8")); 0701 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0702 0703 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/exp_inv.qif")); 0704 exp1.setCodec(QStringLiteral("UTF-8")); 0705 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0706 } 0707 } 0708 0709 { 0710 // Test transfer qif 0711 SKGDocumentBank document1; 0712 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0713 SKGError err; 0714 { 0715 // Scope of the transaction 0716 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0717 0718 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/t2.qif")); 0719 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0720 } 0721 { 0722 SKGAccountObject account(&document1); 0723 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("COURANT")), true) 0724 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0725 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("4767.97")) 0726 } 0727 { 0728 SKGAccountObject account(&document1); 0729 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("CODEVI")), true) 0730 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0731 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-4767.97")) 0732 } 0733 } 0734 0735 { 0736 // 233930 0737 SKGDocumentBank document1; 0738 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0739 SKGError err; 0740 { 0741 // Scope of the transaction 0742 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0743 0744 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/233930.qif")); 0745 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0746 } 0747 } 0748 0749 { 0750 // Quicken 0751 SKGDocumentBank document1; 0752 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0753 SKGError err; 0754 { 0755 // Scope of the transaction 0756 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0757 0758 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/quicken.qif")); 0759 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0760 } 0761 } 0762 0763 { 0764 // 267996 0765 SKGDocumentBank document1; 0766 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0767 SKGError err; 0768 { 0769 // Scope of the transaction 0770 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0771 0772 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/267996.qif")); 0773 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0774 } 0775 { 0776 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif1/267996.csv")); 0777 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0778 } 0779 } 0780 0781 { 0782 // 271708 0783 SKGDocumentBank document1; 0784 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0785 SKGError err; 0786 { 0787 // Scope of the transaction 0788 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0789 0790 { 0791 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/271708/10Compte A.qif")); 0792 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0793 } 0794 { 0795 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/271708/20Compte B.qif")); 0796 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0797 } 0798 { 0799 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/271708/30Compte C.qif")); 0800 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0801 } 0802 { 0803 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif1/271708/40Compte D.qif")); 0804 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0805 } 0806 } 0807 0808 { 0809 SKGAccountObject account(&document1); 0810 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("10Compte A")), true) 0811 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0812 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("0")) 0813 } 0814 { 0815 SKGAccountObject account(&document1); 0816 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("20Compte B")), true) 0817 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0818 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("10")) 0819 } 0820 { 0821 SKGAccountObject account(&document1); 0822 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("30Compte C")), true) 0823 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0824 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("20")) 0825 } 0826 { 0827 SKGAccountObject account(&document1); 0828 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("40Compte D")), true) 0829 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0830 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("40")) 0831 } 0832 } 0833 0834 // End test 0835 SKGENDTEST() 0836 } // NOLINT(readability/fn_size)