Package com.wesabe.api.accounts.entities

Examples of com.wesabe.api.accounts.entities.TxactionListItem


   
    @Test
    public void itCanCalculateRunningTotalBalances() {
      txactionList.calculateRunningTotalBalances(Lists.newArrayList(checkingUSD, cashUSD, creditEUR), USD, exchangeRates);
      // latest account balances determine the initial amount
      assertEquals(new TxactionListItem(wholeFoodsUSD,       money("10270.83", USD)),   txactionList.get(0));
      // 2nd account balance is ignored here
      assertEquals(new TxactionListItem(starbucksEUR,        money("10315.83", USD)),   txactionList.get(1));
      assertEquals(new TxactionListItem(checkingAtmWithdrawalUSD, money("10318.11", USD)),   txactionList.get(2));
      assertEquals(new TxactionListItem(starbucksUSD,       money("10398.11", USD)),   txactionList.get(3));
      assertEquals(new TxactionListItem(cashAtmWithdrawalUSD,   money("10401.06", USD)),   txactionList.get(4));
      assertEquals(new TxactionListItem(mixtGreensUSD,       money("10401.06", USD)),   txactionList.get(5));
    }
View Full Code Here


      assertEquals(item, item);
    }
   
    @Test
    public void itEqualsAnotherInstanceWithTheSameTxactionAndBalance() {
      assertEquals(item, new TxactionListItem(txaction, balance));
    }
View Full Code Here

      assertEquals(item, new TxactionListItem(txaction, balance));
    }
   
    @Test
    public void itHasTheSameHashCodeAsAnotherInstanceWithTheSameTxactionAndBalance() {
      assertEquals(item.hashCode(), new TxactionListItem(txaction, balance).hashCode());
    }
View Full Code Here

   
    // hack of the end of the list since they are not useful in balance calculation
    applyLimit(resultTxactions);

    for (Txaction txaction : resultTxactions) {
      txactionList.add(new TxactionListItem(txaction));
    }
   
    if (tags.isEmpty() && merchantNames.isEmpty() && calculateBalances) {
      // calculate balances before removing the offset as those Txactions may affect the balances
      txactionList.calculateRunningTotalBalances(accounts, currency, exchangeRateMap);
View Full Code Here

TOP

Related Classes of com.wesabe.api.accounts.entities.TxactionListItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.