Ejemplo n.º 1
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);
   }
 }
Ejemplo n.º 2
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);
 }