Package com.wesabe.xmlson

Examples of com.wesabe.xmlson.XmlsonObject


      when(txaction.getCheckNumber()).thenReturn(null);
      when(txaction.getNote()).thenReturn("A thing.");
      when(txaction.getTaggedAmounts()).thenReturn(new ArrayList<TaggedAmount>());
      when(txaction.getAttachments()).thenReturn(new HashSet<Attachment>());
     
      this.accountRepresentation = new XmlsonObject("account");
     
      this.accountPresenter = mock(AccountBriefPresenter.class);
      when(accountPresenter.present(Mockito.any(Account.class))).thenReturn(accountRepresentation);
     
      this.merchantPresenter = mock(MerchantReferencePresenter.class);
View Full Code Here


      super.setup();
    }
   
    @Test
    public void itIsNamedTransaction() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getName(), is("transaction"));
    }
View Full Code Here

      assertThat(representation.getName(), is("transaction"));
    }
   
    @Test
    public void itHasTheTransactionId() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getInteger("id"), is(200497));
    }
View Full Code Here

      assertThat(representation.getInteger("id"), is(200497));
    }
   
    @Test
    public void itHasAUri() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("uri"), is("/transactions/200497"));
    }
View Full Code Here

      assertThat(representation.getString("uri"), is("/transactions/200497"));
    }
   
    @Test
    public void itHasABriefAccountRepresentation() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.get("account"), is((XmlsonElement) accountRepresentation));
     
      verify(accountPresenter).present(account);
    }
View Full Code Here

      verify(accountPresenter).present(account);
    }
   
    @Test
    public void itHasTheDatePosted() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("date"), is("20080904"));
    }
View Full Code Here

      assertThat(representation.getString("date"), is("20080904"));
    }
   
    @Test
    public void itHasTheOriginalDatePosted() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("original-date"), is("20080906"));
    }
View Full Code Here

      assertThat(representation.getString("original-date"), is("20080906"));
    }
   
    @Test
    public void itHasTheAmount() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      final XmlsonObject amount = (XmlsonObject) representation.get("amount");
      assertThat(amount.getString("display"), is("-$33.40"));
      assertThat(amount.getString("value"), is("-33.40"));
    }
View Full Code Here

      assertThat(amount.getString("value"), is("-33.40"));
    }
   
    @Test
    public void itHasANullMerchant() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("merchant"), is(nullValue()));
    }
View Full Code Here

      assertThat(representation.getString("merchant"), is(nullValue()));
    }
   
    @Test
    public void itHasANullCheckNumber() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("check-number"), is(nullValue()));
    }
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.