Package com.wesabe.xmlson

Examples of com.wesabe.xmlson.XmlsonObject


      assertThat(representation.getString("check-number"), is(nullValue()));
    }
   
    @Test
    public void itHasANullTransfer() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("transfer"), is(nullValue()));
    }
View Full Code Here


      assertThat(representation.getString("transfer"), is(nullValue()));
    }
   
    @Test
    public void itHasAnUneditedName() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("unedited-name"), is("BLAH"));
    }
View Full Code Here

      assertThat(representation.getString("unedited-name"), is("BLAH"));
    }
   
    @Test
    public void itHasANote() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("note"), is("A thing."));
    }
View Full Code Here

      assertThat(representation.getString("note"), is("A thing."));
    }
       
    @Test
    public void itHasAnEmptyArrayOfTags() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      final XmlsonArray tags = (XmlsonArray) representation.get("tags");
      assertThat(tags.getMembers().size(), is(0));
    }
View Full Code Here

      when(txaction.getCheckNumber()).thenReturn("1070");
    }
   
    @Test
    public void itHasACheckNumber() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat(representation.getString("check-number"), is("1070"));
    }
View Full Code Here

    @Override
    public void setup() throws Exception {
      super.setup();
     
      this.merchant = mock(Merchant.class);
      this.merchantRepresentation = new XmlsonObject("merchant");
      when(merchantPresenter.present(Mockito.any(Merchant.class))).thenReturn(merchantRepresentation);
     
      when(txaction.getMerchant()).thenReturn(merchant);
    }
View Full Code Here

      when(txaction.getMerchant()).thenReturn(merchant);
    }
   
    @Test
    public void itHasAMerchant() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      assertThat((XmlsonObject) representation.get("merchant"), is(merchantRepresentation));
     
      verify(merchantPresenter).present(merchant);
    }
View Full Code Here

    @Override
    public void setup() throws Exception {
      super.setup();
     
      this.attachment = mock(Attachment.class);
      this.attachmentRepresentation = new XmlsonObject("attachment");
      when(attachmentPresenter.present(Mockito.any(Attachment.class))).thenReturn(attachmentRepresentation);
     
      when(txaction.getAttachments()).thenReturn(ImmutableSet.of(attachment));
    }
View Full Code Here

      when(txaction.getAttachments()).thenReturn(ImmutableSet.of(attachment));
    }
   
    @Test
    public void itHasAnAttachment() throws Exception {
      final XmlsonObject representation = presenter.present(txaction, Locale.UK);
     
      final XmlsonArray attachments = (XmlsonArray) representation.get("attachments");
      assertThat(attachments.getMembers().size(), is(1));
     
      final XmlsonObject attachment = (XmlsonObject) attachments.getMembers().get(0);
      assertThat(attachment, is(attachmentRepresentation));
     
      verify(attachmentPresenter).present(this.attachment);
    }
View Full Code Here

    @Override
    public void setup() throws Exception {
      super.setup();

      this.taggedAmount = mock(TaggedAmount.class);
      this.taggedAmountRepresentation = new XmlsonObject("tag");
      when(taggedAmountPresenter.present(Mockito.any(TaggedAmount.class), Mockito.any(Locale.class))).thenReturn(taggedAmountRepresentation);

      when(txaction.getTaggedAmounts()).thenReturn(ImmutableList.of(taggedAmount));
    }
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.