Examples of calculateBalance()


Examples of org.internna.ossmoney.model.Account.calculateBalance()

    register.setDate(new Date());
    register.setTargetAccount("Test account");
    register.setType(Register.AccountType.BANK);
    Account account = qifImporterService.createAccount(Locale.US, institution, register);
    assertNotNull("Account created", account);
    assertEquals("Amount processed", new Double(20), new Double(account.calculateBalance().doubleValue()));
    assertEquals("Account name processed", "Test account", account.getName());
    assertEquals("Financial institution processed", institution, account.getHeldAt());
    assertTrue("User correctly assumed", account.belongsTo(UserDetails.findCurrentUser()));
  }
View Full Code Here

Examples of org.internna.ossmoney.model.Account.calculateBalance()

    transaction.getAccountTransaction().getAccount().setId(1L);
    transaction.getAccountTransaction().setAmount(BigDecimal.TEN);
    transaction.getAccountTransaction().setOperationDate(DateUtils.getMidnight(new Date()));
    transaction.getAccountTransaction().setSubcategory(new Subcategory());
    transaction.getAccountTransaction().getSubcategory().setCategory("category.investment.buy");
    double balance = account.calculateBalance().doubleValue();
    investmentService.addInvestment(account.getOwner(), account, transaction, 11D);
    assertNotNull("Transaction persisted", transaction.getId());
    assertNotNull("Investment price persisted", transaction.getPrice().getId());
    assertNotNull("Account transaction persisted", transaction.getAccountTransaction().getId());
    assertEquals("One price available for the investment", new Double(2D), investment.getCurrentPrice());
View Full Code Here

Examples of org.internna.ossmoney.model.Account.calculateBalance()

    investmentService.addInvestment(account.getOwner(), account, transaction, 11D);
    assertNotNull("Transaction persisted", transaction.getId());
    assertNotNull("Investment price persisted", transaction.getPrice().getId());
    assertNotNull("Account transaction persisted", transaction.getAccountTransaction().getId());
    assertEquals("One price available for the investment", new Double(2D), investment.getCurrentPrice());
    assertEquals("Balance was updated accordingly", new Double(balance - 21D), new Double(account.calculateBalance().doubleValue()));
  }

}
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.