File tree Expand file tree Collapse file tree
app/src/test/java/org/gnucash/android/test/unit/export Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments