コード例 #1
0
 private void assertAccountBlotterTotal(Account a1, DateTime start, DateTime end, int total) {
   WhereFilter filter = enhanceFilterForAccountBlotter(WhereFilter.empty());
   filter.btw(
       BlotterFilter.DATETIME,
       String.valueOf(start.atMidnight().asLong()),
       String.valueOf(end.atDayEnd().asLong()));
   filter.eq(BlotterFilter.FROM_ACCOUNT_ID, String.valueOf(a1.id));
   TransactionsTotalCalculator calculator = new TransactionsTotalCalculator(db, filter);
   assertEquals(total, calculator.getAccountTotal().balance);
 }
コード例 #2
0
 private void assertTotals(long... totalAmounts) {
   WhereFilter filter = WhereFilter.empty();
   TransactionsTotalCalculator calculator = new TransactionsTotalCalculator(db, filter);
   Total[] totals = calculator.getTransactionsBalance();
   assertEquals(totalAmounts.length, totals.length);
   for (int i = 0; i < totalAmounts.length; i++) {
     assertEquals("Total " + i, totalAmounts[i], totals[i].balance);
   }
 }
コード例 #3
0
 private Cursor getBlotterForAccount(Account account) {
   WhereFilter accountFilter = WhereFilter.copyOf(options.filter);
   accountFilter.put(Criteria.eq(BlotterFilter.FROM_ACCOUNT_ID, String.valueOf(account.id)));
   return db.getBlotterForAccount(accountFilter);
 }
コード例 #4
0
 private WhereFilter createBlotterForAccountFilter(Account account) {
   WhereFilter filter = WhereFilter.empty();
   filter.put(Criteria.eq(BlotterFilter.FROM_ACCOUNT_ID, String.valueOf(account.id)));
   return filter;
 }
コード例 #5
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   CategoryReport r = new CategoryReport(getContext(), c1);
   filter = r.createFilterForSubCategory(db, WhereFilter.empty(), categories.get("A").id);
 }