@Test public void bulkInsert_updatesAccountsBalances() { Account account = insertAccount(); final Transaction transaction = new Transaction(); transaction.setAccountTo(account); transaction.setCategory(Category.getIncome()); transaction.setAmount(42); bulkInsert(TransactionsProvider.uriTransactions(), transaction.asContentValues()); account = getAccount(account.getId()); assertEquals(42, 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; }