Package com.wesabe.api.accounts.entities

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


    @Before
    @Override
    public void setup() throws Exception {
      super.setup();
     
      this.checking = new Account("Checking", USD);
      checking.setRelativeId(2);
     
      this.savings = new Account("Savings", USD);
      savings.setRelativeId(1);
     
      this.weirdOne = new Account("Brian Has Insane Accounts", USD);
      weirdOne.setRelativeId(400);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings, weirdOne));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/400"));
View Full Code Here


    @Before
    @Override
    public void setup() throws Exception {
      super.setup();
     
      this.checking = new Account("Checking", USD);
      checking.setRelativeId(2);
     
      this.savings = new Account("Savings", USD);
      savings.setRelativeId(1);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/woof"), new UriParam("/accouFFFnts/2"));
View Full Code Here

@RunWith(Enclosed.class)
public class AccountTest {
  public static class An_Account {
    @Test
    public void itHasAMutableAccountKey() throws Exception {
      Account account = new Account();
      assertNull(account.getAccountKey());
      account.setAccountKey("woo");
      assertEquals("woo", account.getAccountKey());
    }
View Full Code Here

      assertEquals("woo", account.getAccountKey());
    }
   
    @Test
    public void itHasAMutableName() throws Exception {
      Account account = new Account();
      assertNull(account.getName());
      account.setName("woo");
      assertEquals("woo", account.getName());
    }
View Full Code Here

      assertEquals("woo", account.getName());
    }
   
    @Test
    public void itHasAMutableStatus() throws Exception {
      Account account = new Account();
      assertEquals(AccountStatus.ACTIVE, account.getStatus());
      account.setStatus(AccountStatus.DELETED);
      assertEquals(AccountStatus.DELETED, account.getStatus());
    }
View Full Code Here

      assertEquals(AccountStatus.DELETED, account.getStatus());
    }
   
    @Test
    public void itHasAMutableRelativeId() throws Exception {
      Account account = new Account();
      assertNull(account.getRelativeId());
      account.setRelativeId(300);
      assertEquals(Integer.valueOf(300), account.getRelativeId());
    }
View Full Code Here

      assertEquals(Integer.valueOf(300), account.getRelativeId());
    }
   
    @Test
    public void itHasAMutableCurrency() throws Exception {
      Account account = new Account();
      assertEquals(USD, account.getCurrency());
      account.setCurrency(EUR);
      assertEquals(EUR, account.getCurrency());
    }
View Full Code Here

      assertEquals(EUR, account.getCurrency());
    }
   
    @Test
    public void itIsNotEqualToNull() throws Exception {
      assertFalse(new Account().equals(null));
    }
View Full Code Here

      assertFalse(new Account().equals(null));
    }
   
    @Test
    public void itIsNotEqualToANonAccount() throws Exception {
      assertFalse(new Account().equals("woo"));
    }
View Full Code Here

      assertFalse(new Account().equals("woo"));
    }
   
    @Test
    public void itIsNotEqualToAnotherAccountWithDifferentFields() throws Exception {
      final Account firstAccount = new Account();
      final Account otherAccount = new Account();
     
      inject(Account.class, firstAccount, "id", Integer.valueOf(300));
      inject(Account.class, firstAccount, "guid", "0123456789");
     
      inject(Account.class, otherAccount, "id", Integer.valueOf(200));
      inject(Account.class, otherAccount, "guid", "9876543210");
     
      assertFalse(firstAccount.equals(otherAccount));
      assertFalse(firstAccount.hashCode() == otherAccount.hashCode());
    }
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.