Package com.wesabe.api.accounts.entities

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


    @Before
    public void setup() throws Exception {
      this.checking = mock(Account.class);
      when(checking.toString()).thenReturn("CHECKING");
     
      this.group = new AccountGroup("Checking", "checking", new AccountList(checking));
    }
View Full Code Here


    private final Account checking = Account.ofType(AccountType.CHECKING);
    private final AccountGroup group = new AccountGroup("Checking", "checking", new AccountList(checking));

    @Test
    public void itEqualsAnotherAccountGroupWithTheSameNameIdAndAccounts() {
      final AccountGroup anotherGroup = new AccountGroup(group.getName(), group.getId(), group.getAccounts());
      assertThat(group.equals(anotherGroup), is(true));
      assertThat(group.hashCode(), is(anotherGroup.hashCode()));
    }
View Full Code Here

      assertThat(group.hashCode(), is(anotherGroup.hashCode()));
    }
   
    @Test
    public void itDoesNotEqualAnotherAccountGroupWithADifferentName() {
      final AccountGroup anotherGroup = new AccountGroup("Not Checking", group.getId(), group.getAccounts());
      assertThat(group.equals(anotherGroup), is(false));
      assertThat(group.hashCode(), is(not(anotherGroup.hashCode())));
    }
View Full Code Here

      assertThat(group.hashCode(), is(not(anotherGroup.hashCode())));
    }
   
    @Test
    public void itDoesNotEqualAnotherAccountGroupWithDifferentId() {
      final AccountGroup anotherGroup = new AccountGroup(group.getName(), "notchecking", group.getAccounts());
      assertThat(group.equals(anotherGroup), is(false));
      assertThat(group.hashCode(), is(not(anotherGroup.hashCode())));
    }
View Full Code Here

      assertThat(group.hashCode(), is(not(anotherGroup.hashCode())));
    }
   
    @Test
    public void itDoesNotEqualAnotherAccountGroupWithDifferentAccounts() {
      final AccountGroup anotherGroup = new AccountGroup(group.getName(), group.getId(), new AccountList(checking, checking));
      assertThat(group.equals(anotherGroup), is(false));
      assertThat(group.hashCode(), is(not(anotherGroup.hashCode())));
    }
View Full Code Here

   
    @Test
    public void itSplitsAccountsIntoGroupsByType() {
      assertEquals(
          Lists.newArrayList(
              new AccountGroup("Checking", "checking", new AccountList(checking)),
              new AccountGroup("Savings", "savings", new AccountList(savings))),
          new AccountList(checking, savings).getAccountGroups());
    }
View Full Code Here

   
    @Test
    public void itConsidersCashAndManualAccountsToBelongToTheSameGroup() {
      assertEquals(
          Lists.newArrayList(
              new AccountGroup("Cash", "cash", new AccountList(cash, manual))),
          new AccountList(cash, manual).getAccountGroups());
    }
View Full Code Here

   
    @Test
    public void itGroupsArchivedAccountsTogether() throws Exception {
      assertEquals(
          Lists.newArrayList(
              new AccountGroup("Checking", "checking", new AccountList(checking)),
              new AccountGroup("Savings", "savings", new AccountList(savings)),
              new AccountGroup("Archived", "archived", new AccountList(oldChecking))
          ),
          new AccountList(checking, savings, oldChecking).getAccountGroups()
      );
    }
View Full Code Here

TOP

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

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.