Package com.wesabe.xmlson

Examples of com.wesabe.xmlson.XmlsonObject


      assertThat(representation.getInteger("position"), is(0));
    }
   
    @Test
    public void itHasTheAccountsUri() throws Exception {
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);
     
      assertThat(representation.getString("uri"), is("/accounts/5"));
    }
View Full Code Here


      assertThat(representation.getString("uri"), is("/accounts/5"));
    }
   
    @Test
    public void itHasTheAccountsType() throws Exception {
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);
     
      assertThat(representation.getString("type"), is("Checking"));
    }
View Full Code Here

      assertThat(representation.getString("type"), is("Checking"));
    }
   
    @Test
    public void itHasTheAccountsCurrency() throws Exception {
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);
     
      assertThat(representation.getString("currency"), is("USD"));
    }
View Full Code Here

      assertThat(representation.getString("currency"), is("USD"));
    }
   
    @Test
    public void itHasTheAccountsStatus() throws Exception {
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);
     
      assertThat(representation.getString("status"), is("active"));
    }
View Full Code Here

    @Test
    public void itHasTheAccountsBalanceIfAny() throws Exception {
      when(account.hasBalance()).thenReturn(true);
      when(account.getBalance()).thenReturn(money("344.00", USD));
     
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);
     
      final XmlsonObject balance = (XmlsonObject) representation.get("balance");
      assertThat(balance.getString("display"), is("344,00 $"));
      assertThat(balance.getString("value"), is("344.00"));
    }
View Full Code Here

    public void itHasTheLastBalanceAtDateIfThereIsABalance() throws Exception {
      when(account.hasBalance()).thenReturn(true);
      when(account.getBalance()).thenReturn(money("344.00", USD));
      when(account.getLastActivityDate()).thenReturn(new DateTime(2009, 5, 22, 13, 25, 0, 0, DateTimeZone.UTC));
     
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);
     
      assertThat(representation.getString("last-balance-at"), is("20090522T132500Z"));
    }
View Full Code Here

      assertThat(representation.getString("last-balance-at"), is("20090522T132500Z"));
    }
   
    @Test
    public void itHasTheFinancialInst() throws Exception {
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);
     
      assertThat(representation.get("financial-institution"), is((XmlsonElement) financialInstRepresentation));
    }
View Full Code Here

   
    @Test
    public void itDoesNotHaveTheFinancialInstIfTheAccountHasNone() throws Exception {
      when(account.getFinancialInst()).thenReturn(null);
     
      final XmlsonObject representation = presenter.present(account, Locale.GERMANY);

      assertThat(representation.get("financial-institution"), is(nullValue()));
    }   
View Full Code Here

      this.presenter = new AccountGroupPresenter(exchangeRateMap, moneyPresenter, accountReferencePresenter);
    }
   
    @Test
    public void itHasTheGroupsName() throws Exception {
      final XmlsonObject representation = presenter.present(group, USD, Locale.KOREA);
     
      assertThat(representation.getString("name"), is("Checking"));
    }
View Full Code Here

      assertThat(representation.getString("name"), is("Checking"));
    }
   
    @Test
    public void itHasTheGroupsUri() throws Exception {
      final XmlsonObject representation = presenter.present(group, USD, Locale.KOREA);
     
      assertThat(representation.getString("uri"), is("/account-groups/checking"));
    }
View Full Code Here

TOP

Related Classes of com.wesabe.xmlson.XmlsonObject

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.