Examples of Txaction


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

      assertEquals(accountBalance.getBalance(), calculator().getBalance(txaction));
    }
   
    @Test
    public void itIncludesTxactionsAfterTheMostRecentAccountBalance() throws Exception {
      Txaction firstTxaction = new Txaction(account, decimal("-5.00"), now());
      txactions.add(firstTxaction);
     
      TxactionBalanceCalculator calculator = calculator();
      assertEquals(money("95.00", USD), calculator.getBalance(firstTxaction));
      assertEquals(money("100.00", USD), calculator.getBalance(txaction));
View Full Code Here

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

    }
   
    @Test
    public void itIgnoresAllButTheFirstAccountBalance() throws Exception {
      for (int i = 0; i < 10; i++) {
        txactions.add(new Txaction(account, decimal("-5.00"), now().minusDays(20+i)));
      }
      // create a balance in the middle of those txactions
      accountBalances.add(new AccountBalance(account, decimal("5000"), now().minusDays(25)));
     
      TxactionBalanceCalculator calculator = calculator();
View Full Code Here

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

      credit.setCurrency(USD);
      cash.setCurrency(USD);
      savings.setCurrency(EUR);
     
      checkingTxactions = Lists.newArrayList(
          newerThanFirstBalance = new Txaction(checking, decimal("-10.00"), now()),
          firstTxactionPastFirstBalance = new Txaction(checking, decimal("-10.00"), now().minusDays(1)));
      creditTxactions = Lists.newArrayList(
          secondTxactionPastFirstBalance = new Txaction(credit, decimal("-20.00"), now().minusDays(2)),
          thirdTxactionPastFirstBalance = new Txaction(credit, decimal("-20.00"), now().minusDays(3)),
          firstTxactionAfterCreditIsReset = new Txaction(credit, decimal("400.00"), now().minusDays(21)));
      cashTxactions = Lists.newArrayList(
          cashTxaction = new Txaction(cash, decimal("-2.00"), now().minusDays(4)));
      savingsTxactions = Lists.newArrayList(
          fifthTxactionPastFirstBalance = new Txaction(savings, decimal("100.00"), now().minusDays(8)),
          sixthTxactionPastFirstBalance = new Txaction(savings, decimal("100.00"), now().minusDays(15)),
          lastTxaction = new Txaction(savings, decimal("100.00"), now().minusDays(200)));
     
      accounts = Sets.newHashSet(checking, credit, cash, savings);
    }
View Full Code Here

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

          new AccountBalance(account, decimal("10.00"), apr1st));
     
      inject(Account.class, account, "accountBalances", accountBalances);
     
      Set<Txaction> txactions = Sets.newHashSet(
          new Txaction(account, decimal("-1.50"), jun14th));
     
      inject(Account.class, account, "txactions", txactions);
    }
View Full Code Here

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

    private Tag friends = new Tag("friends");
   
    @Before
    public void setup() {
      final Account checking = new Account("Checking", USD);
      final Txaction paidRent = new Txaction(checking, decimal("-1500.00"), date(2009, 1, 18));
      final Txaction boughtLunch = new Txaction(checking, decimal("-12.34"), new DateTime(2009, 1, 18, 23, 0, 0, 0));
      final Txaction deletedLunch = new Txaction(checking, decimal("-12.33"), new DateTime(2009, 1, 18, 23, 0, 0, 0));
      final Collection<Txaction> txactions = ImmutableList.of(paidRent, boughtLunch, deletedLunch);
     
      paidRent.addTag(rent);
      boughtLunch.addTag(lunch);
      boughtLunch.addTag(food);
      boughtLunch.addTag(restaurants);
      boughtLunch.addTag(friends, decimal("-6.45"));
     
      deletedLunch.addTag(lunch);
      deletedLunch.addTag(food);
      deletedLunch.addTag(restaurants);
      deletedLunch.addTag(friends, decimal("-6.45"));
      deletedLunch.setStatus(TxactionStatus.DELETED);
     
      final TagSummarizer summarizer = new TagSummarizer(new CurrencyExchangeRateMap());
     
      this.summaries = summarizer.summarize(txactions, USD);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.