@Test public void whenTransaction_areDeleted_onlyPositiveIndexShouldBeForwardedToData() { transactionDao.deleteTransactions(getHttpTransactionsWithIndices(0, -1, -40, -100, 2, 350)); verifyOnlyTransactionsDeletedAreWithIndices(2, 350); }
@Override public int deleteTransactions(HttpTransaction... httpTransactions) { int updates = 0; for (HttpTransaction httpTransaction : httpTransactions) { if (httpTransaction.getId() > 0 && transactionDataStore.removeTransactionWithIndex(httpTransaction.getId())) { updates++; } } return updates; }
IMDBTransactionDao implements TransactionDao { @Override public int deleteTransactions(HttpTransaction... httpTransactions) { int updates = 0; for (HttpTransaction httpTransaction : httpTransactions) { if (httpTransaction.getId() > 0 && transactionDataStore.removeTransactionWithIndex(httpTransaction.getId())) { updates++; } } return updates; } }
IMDBTransactionDao implements TransactionDao { @Override public int deleteTransactions(HttpTransaction... httpTransactions) { int updates = 0; for (HttpTransaction httpTransaction : httpTransactions) { if (httpTransaction.getId() > 0 && transactionDataStore.removeTransactionWithIndex(httpTransaction.getId())) { updates++; } } return updates; } IMDBTransactionDao(TransactionDataStore transactionDataStore, TransactionArchComponentProvider transactionArchComponentProvider, TransactionPredicateProvider transactionPredicateProvider); }
IMDBTransactionDao implements TransactionDao { @Override public int deleteTransactions(HttpTransaction... httpTransactions) { int updates = 0; for (HttpTransaction httpTransaction : httpTransactions) { if (httpTransaction.getId() > 0 && transactionDataStore.removeTransactionWithIndex(httpTransaction.getId())) { updates++; } } return updates; } IMDBTransactionDao(TransactionDataStore transactionDataStore, TransactionArchComponentProvider transactionArchComponentProvider, TransactionPredicateProvider transactionPredicateProvider); @Override long insertTransaction(HttpTransaction httpTransaction); @Override int updateTransaction(HttpTransaction httpTransaction); @Override int deleteTransactions(HttpTransaction... httpTransactions); @Override int deleteTransactionsBefore(Date beforeDate); @Override int clearAll(); @Override DataSource.Factory<Integer, HttpTransaction> getAllTransactions(); @Override LiveData<HttpTransaction> getTransactionsWithId(long id); @Override DataSource.Factory<Integer, HttpTransaction> getAllTransactionsWith(String key, SearchType searchType); }
IMDBTransactionDao implements TransactionDao { @Override public int deleteTransactions(HttpTransaction... httpTransactions) { int updates = 0; for (HttpTransaction httpTransaction : httpTransactions) { if (httpTransaction.getId() > 0 && transactionDataStore.removeTransactionWithIndex(httpTransaction.getId())) { updates++; } } return updates; } IMDBTransactionDao(TransactionDataStore transactionDataStore, TransactionArchComponentProvider transactionArchComponentProvider, TransactionPredicateProvider transactionPredicateProvider); @Override long insertTransaction(HttpTransaction httpTransaction); @Override int updateTransaction(HttpTransaction httpTransaction); @Override int deleteTransactions(HttpTransaction... httpTransactions); @Override int deleteTransactionsBefore(Date beforeDate); @Override int clearAll(); @Override DataSource.Factory<Integer, HttpTransaction> getAllTransactions(); @Override LiveData<HttpTransaction> getTransactionsWithId(long id); @Override DataSource.Factory<Integer, HttpTransaction> getAllTransactionsWith(String key, SearchType searchType);  }