Last active
January 4, 2017 21:33
-
-
Save izmajlowiczl/b82c21b52aec7bba5dda8d3baf33607d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Test | |
| public void storeSingleWallet() { | |
| Wallet bankWallet = Wallet.create(randomUUID(), "bank"); | |
| storage.insert(bankWallet); | |
| assertThat(getStoredWalletNames()) | |
| .containsExactly("bank"); | |
| } | |
| private List<String> getStoredWalletNames() { | |
| Cursor cursor = db.rawQuery(listWalletNamesSql(), null); | |
| if (cursor == null) { | |
| fail("Wallet was not stored"); | |
| cursor.close(); | |
| } | |
| List<String> storedWalletNames = new ArrayList<>(); | |
| while (cursor.moveToNext()) { | |
| storedWalletNames.add(cursor.getString(0)); | |
| } | |
| return storedWalletNames; | |
| } | |
| private String listWalletNamesSql() { | |
| return String.format("SELECT name FROM tbl_wallet"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment