@Test public void delete_updatesAccountsBalances() { Account account = insertAccount(); final Transaction transaction = new Transaction(); transaction.setAccountFrom(account); transaction.setCategory(Category.getExpense()); transaction.setAmount(42); insert(TransactionsProvider.uriTransactions(), transaction); delete("delete", TransactionsProvider.uriTransactions(), null); account = getAccount(account.getId()); assertEquals(0, account.getBalance()); }
public static Uri uriTransactions() { return uriModels(TransactionsProvider.class, Tables.Transactions.TABLE_NAME); }
TransactionsProvider extends ModelProvider { public static Uri uriTransactions() { return uriModels(TransactionsProvider.class, Tables.Transactions.TABLE_NAME); } }
TransactionsProvider extends ModelProvider { public static Uri uriTransactions() { return uriModels(TransactionsProvider.class, Tables.Transactions.TABLE_NAME); }  }
TransactionsProvider extends ModelProvider { public static Uri uriTransactions() { return uriModels(TransactionsProvider.class, Tables.Transactions.TABLE_NAME); }  static Uri uriTransactions(); static Uri uriTransaction(String transactionId); static void updateAccountBalance(SQLiteDatabase database, String accountId); static void updateAllAccountsBalances(SQLiteDatabase database); }
TransactionsProvider extends ModelProvider { public static Uri uriTransactions() { return uriModels(TransactionsProvider.class, Tables.Transactions.TABLE_NAME); }  static Uri uriTransactions(); static Uri uriTransaction(String transactionId); static void updateAccountBalance(SQLiteDatabase database, String accountId); static void updateAllAccountsBalances(SQLiteDatabase database); static final String URI_PARAM_JOIN_TABLE; static final String URI_VALUE_JOIN_TABLE_ACCOUNTS_FROM; static final String URI_VALUE_JOIN_TABLE_ACCOUNTS_TO; static final String URI_VALUE_JOIN_TABLE_CATEGORIES; static final String URI_VALUE_JOIN_TABLE_TAGS; }