Package com.wesabe.api.accounts.entities

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


@RunWith(Enclosed.class)
public class AccountBalanceTest {
  public static class An_Account_Balance {
    @Test
    public void itHasABalance() {
      AccountBalance accountBalance = new AccountBalance(new Account("Checking", USD), decimal("10.00"), new DateTime());
      assertEquals(money("10.00", USD), accountBalance.getBalance());
    }
View Full Code Here


      assertEquals(money("10.00", USD), accountBalance.getBalance());
    }
   
    @Test
    public void itHasAnAccount() {
      Account account = new Account("Checking", USD);
      AccountBalance accountBalance = new AccountBalance(account, decimal("10.00"), new DateTime());
      assertEquals(account, accountBalance.getAccount());
    }
View Full Code Here

      assertEquals(account, accountBalance.getAccount());
    }
   
    @Test
    public void itCanBeConstructedWithAnAccountAndAmountAndDate() {
      new AccountBalance(new Account("Checking", USD), decimal("10.00"), new DateTime());
    }
View Full Code Here

      new AccountBalance(new Account("Checking", USD), decimal("10.00"), new DateTime());
    }
   
    @Test
    public void itCanBeConstructedWithAnAccountAndAMoneyWithMatchingCurrencies() {
      Account account = new Account("Checking", USD);
      Money balance = money("10.00", USD);
      new AccountBalance(account, balance, new DateTime());
    }
View Full Code Here

      new AccountBalance(account, balance, new DateTime());
    }
   
    @Test(expected=CurrencyMismatchException.class)
    public void itCannotBeConstructedWithAnAccountWhoseCurrencyMismatchesTheMoneyBalance() {
      Account account = new Account("Checking", USD);
      Money mismatchedBalance = money("10.00", GBP);
      new AccountBalance(account, mismatchedBalance, new DateTime());
    }
View Full Code Here

    @Override
    @Before
    public void setup() throws Exception {
      super.setup();
     
      this.checking = new Account("Checking", USD);
      this.hierarchy = builder.build(
        ImmutableList.of(
          spent("400.00").from(checking).at("Whole Foods").on("food", "groceries").build(),
          spent("103.50").from(checking).at("ATM").on("cash", decimal("-100.00")).on("fee", decimal("-3.50")).build()
        ),
View Full Code Here

    @Override
    @Before
    public void setup() throws Exception {
      super.setup();
     
      this.checking = new Account("Checking", USD);
      this.hierarchy = builder.build(
        ImmutableList.of(
          spent("400.00").from(checking).at("Whole Foods").on("food").build(),
          spent("103.50").from(checking).at("ATM").on("cash").build(),
          spent("200.00").from(checking).at("Rent").on("rent").build()
View Full Code Here

    @Override
    @Before
    public void setup() throws Exception {
      super.setup();
     
      this.checking = new Account("Checking", USD);
      this.hierarchy = builder.build(
        ImmutableList.of(
          spent("400.00").from(checking).at("Whole Foods").build(),
          spent("103.50").from(checking).at("ATM").build(),
          spent("200.00").from(checking).at("Rent").build()
View Full Code Here

    @Override
    @Before
    public void setup() throws Exception {
      super.setup();
     
      this.checking = new Account("Checking", USD);
      this.hierarchy = builder.build(
        ImmutableList.of(
          spent("400.00").from(checking).at("Whole Foods").asDeleted().build(),
          spent("103.50").from(checking).at("ATM").asTransfer().build(),
          spent("200.00").from(checking).at("Rent").asDisabled().build()
View Full Code Here

    @Before
    public void setup() throws Exception {
      super.setup();
     
      this.exchangeRateMap.addExchangeRate(EUR, USD, now(), decimal("1.499900006016309"));
      this.checking = new Account("Checking", USD);
      this.savings = new Account("Savings", EUR);
      this.hierarchy = builder.build(
        ImmutableList.of(
          spent("400.00").from(checking).at("Whole Foods").on("food").build(),
          spent("103.50").from(checking).at("ATM").on("cash").build(),
          spent("200.00").from(savings).at("Rent").on("rent").build()
View Full Code Here

TOP

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

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.