Skip to content

Commit f87b456

Browse files
Alen Siljakrivaldi8
authored andcommitted
basic assert
1 parent 5eec57c commit f87b456

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,14 @@ public void multiCurrencyTransactions_shouldResultInMultipleQifFiles(){
153153
public void description_and_memo_field_test() {
154154
// arrange
155155

156+
String expectedDescription = "my description";
157+
String expectedMemo = "my memo";
158+
156159
AccountsDbAdapter accountsDbAdapter = new AccountsDbAdapter(mDb);
157160
Account account = new Account("Basic Account");
158161
Transaction transaction = new Transaction("One transaction");
159-
transaction.setDescription("my description");
160-
transaction.setNote("my note");
162+
transaction.setDescription(expectedDescription);
163+
transaction.setNote(expectedMemo);
161164
account.addTransaction(transaction);
162165
accountsDbAdapter.addRecord(account);
163166

@@ -180,12 +183,12 @@ public void description_and_memo_field_test() {
180183
try {
181184
BufferedReader reader = new BufferedReader(new FileReader(file));
182185
fileContentsBuilder.append(reader.readLine());
183-
} catch (FileNotFoundException e) {
184-
e.printStackTrace();
185186
} catch (IOException e) {
186187
e.printStackTrace();
187188
}
188189
// todo: check the description & memo fields.
189190
String fileContent = fileContentsBuilder.toString();
191+
assertThat(fileContent.contains(expectedDescription));
192+
assertThat(fileContent.contains(expectedMemo));
190193
}
191194
}

0 commit comments

Comments
 (0)