Skip to content

Commit 12b8702

Browse files
Alen Siljakrivaldi8
authored andcommitted
The test setup, no asserts as I can't run the tests.
1 parent e8c3186 commit 12b8702

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

app/src/test/java/org/gnucash/android/test/unit/export/QifExporterTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,33 @@ public void multiCurrencyTransactions_shouldResultInMultipleQifFiles(){
144144
assertThat(file.length()).isGreaterThan(0L);
145145
}
146146

147+
public void description_and_memo_field_test() {
148+
// setup
149+
150+
AccountsDbAdapter accountsDbAdapter = new AccountsDbAdapter(mDb);
151+
Account account = new Account("Basic Account");
152+
Transaction transaction = new Transaction("One transaction");
153+
transaction.setDescription("my description");
154+
transaction.setNote("my note");
155+
account.addTransaction(transaction);
156+
accountsDbAdapter.addRecord(account);
157+
158+
ExportParams exportParameters = new ExportParams(ExportFormat.QIF);
159+
exportParameters.setExportStartTime(TimestampHelper.getTimestampFromEpochZero());
160+
exportParameters.setExportTarget(ExportParams.ExportTarget.SD_CARD);
161+
exportParameters.setDeleteTransactionsAfterExport(false);
162+
163+
// action
164+
165+
QifExporter qifExporter = new QifExporter(exportParameters, mDb);
166+
List<String> exportedFiles = qifExporter.generateExport();
167+
168+
// assert
169+
170+
assertThat(exportedFiles).hasSize(1);
171+
File file = new File(exportedFiles.get(0));
172+
assertThat(file).exists().hasExtension("qif");
173+
174+
// todo: check the description & memo fields.
175+
}
147176
}

0 commit comments

Comments
 (0)