Package com.wesabe.api.accounts.entities

Examples of com.wesabe.api.accounts.entities.Txaction.compareTo()


    @Test
    public void itComesBeforeAnotherTxactionOnALaterDate() {
      Txaction txactionWithLaterPostedDate = new Txaction(euroSavings, decimal("-34.22"), jun16th);
      assertEquals(-1, txaction.compareTo(txactionWithLaterPostedDate));
      assertEquals(1, txactionWithLaterPostedDate.compareTo(txaction));
    }
   
    @Test
    public void itComesBeforeAnotherTxactionOnTheSameDateWithALaterSequence() {
      Txaction txactionWithLaterSequenceNumber = new Txaction(euroSavings, decimal("-34.22"), jun15th);
View Full Code Here


    @Test
    public void itComesBeforeAnotherTxactionOnTheSameDateWithALaterSequence() {
      Txaction txactionWithLaterSequenceNumber = new Txaction(euroSavings, decimal("-34.22"), jun15th);
      txactionWithLaterSequenceNumber.setSequence(txaction.getSequence()-1);
      assertEquals(-1, txaction.compareTo(txactionWithLaterSequenceNumber));
      assertEquals(1, txactionWithLaterSequenceNumber.compareTo(txaction));
    }
   
    @Test
    public void itIgnoresSequenceWhenOneOrBothTxactionsHaveNullSequences() throws Exception {
      Txaction txactionWithNullSequenceNumber = new Txaction(euroSavings, decimal("-34.22"), jun15th);
View Full Code Here

    public void itIgnoresSequenceWhenOneOrBothTxactionsHaveNullSequences() throws Exception {
      Txaction txactionWithNullSequenceNumber = new Txaction(euroSavings, decimal("-34.22"), jun15th);
      txactionWithNullSequenceNumber.setSequence(null);
      inject(Txaction.class, txactionWithNullSequenceNumber, "createdAt", jun17th);
      assertEquals(-1, txaction.compareTo(txactionWithNullSequenceNumber));
      assertEquals(1, txactionWithNullSequenceNumber.compareTo(txaction));
    }
   
    @Test
    public void itIgnoresCreatedAtDatesWhenOneOrBothTxactionsHaveNullCreatedAtDates() throws Exception {
      Txaction txactionWithNullCreatedAt = new Txaction(euroSavings, decimal("-34.22"), jun15th);
View Full Code Here

    @Test
    public void itIgnoresCreatedAtDatesWhenOneOrBothTxactionsHaveNullCreatedAtDates() throws Exception {
      Txaction txactionWithNullCreatedAt = new Txaction(euroSavings, decimal("-34.22"), jun15th);
      inject(Txaction.class, txactionWithNullCreatedAt, "createdAt", null);
      assertEquals(0, txaction.compareTo(txactionWithNullCreatedAt));
      assertEquals(0, txactionWithNullCreatedAt.compareTo(txaction));
    }
   
    @Test
    public void itComesBeforeAnotherTxactionOnTheSameDateWithTheSameSequenceWithALaterCreationDate() throws Exception {
      Txaction txactionWithLaterCreationDate = new Txaction(euroSavings, decimal("-34.22"), jun15th);
View Full Code Here

    public void itComesBeforeAnotherTxactionOnTheSameDateWithTheSameSequenceWithALaterCreationDate() throws Exception {
      Txaction txactionWithLaterCreationDate = new Txaction(euroSavings, decimal("-34.22"), jun15th);
      txactionWithLaterCreationDate.setSequence(txaction.getSequence());
      inject(Txaction.class, txactionWithLaterCreationDate, "createdAt", jun17th);
      assertEquals(-1, txaction.compareTo(txactionWithLaterCreationDate));
      assertEquals(1, txactionWithLaterCreationDate.compareTo(txaction));
    }
  }
 
  public static class Tagging_A_Transaction {
    final Account account = new Account("checking", USD);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.