Examples of CurrencyExchangeRateMap


Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

    protected TagSummarizer summarizer;
    protected TagHierarchy hierarchy;
   
   
    protected void setup() throws Exception {
      this.exchangeRateMap = new CurrencyExchangeRateMap();
      this.summarizer = new TagSummarizer(exchangeRateMap);
      this.builder = new TagHierarchyBuilder(summarizer, exchangeRateMap);
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

  }

  public static class One_Dollar_Converted_Into_Euros {
    @Test
    public void shouldBeWhateverTheExchangeRateIs() throws Exception {
      CurrencyExchangeRateMap exchangeRates = new CurrencyExchangeRateMap();
      exchangeRates.addExchangeRate(USD, EUR, now(), decimal("0.79"));
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money wayLessInEuros = new Money(decimal("0.79"), EUR);
      Money actualValue = oneDollar.convert(exchangeRates, EUR, now());
      assertEquals(wayLessInEuros, actualValue);
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

      assertEquals(wayLessInEuros, actualValue);
    }

    @Test
    public void shouldRoundDownIfLessThanHalf() throws Exception {
      CurrencyExchangeRateMap exchangeRates = new CurrencyExchangeRateMap();
      exchangeRates.addExchangeRate(USD, EUR, now(), decimal("0.794"));
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money wayLessInEuros = new Money(decimal("0.79"), EUR);
      Money actualValue = oneDollar.convert(exchangeRates, EUR, now());
      assertEquals(wayLessInEuros, actualValue);
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

      assertEquals(wayLessInEuros, actualValue);
    }

    @Test
    public void shouldRoundUpIfHalf() throws Exception {
      CurrencyExchangeRateMap exchangeRates = new CurrencyExchangeRateMap();
      exchangeRates.addExchangeRate(USD, EUR, now(), decimal("0.795"));
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money wayLessInEuros = new Money(decimal("0.80"), EUR);
      Money actualValue = oneDollar.convert(exchangeRates, EUR, now());
      assertEquals(wayLessInEuros, actualValue);
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

      assertEquals(wayLessInEuros, actualValue);
    }

    @Test
    public void shouldRoundUpIfMoreThanHalf() throws Exception {
      CurrencyExchangeRateMap exchangeRates = new CurrencyExchangeRateMap();
      exchangeRates.addExchangeRate(USD, EUR, now(), decimal("0.797"));
      Money oneDollar = new Money(decimal("1.00"), USD);
      Money wayLessInEuros = new Money(decimal("0.80"), EUR);
      Money actualValue = oneDollar.convert(exchangeRates, EUR, now());
      assertEquals(wayLessInEuros, actualValue);
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

      assert(txactionList.isEmpty());
    }
   
    @Test
    public void itIsStillEmptyAfterCalculatingRunningTotalBalances() {
      txactionList.calculateRunningTotalBalances(new ArrayList<Account>(), USD, new CurrencyExchangeRateMap());
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

    }
  }
 
  public static CurrencyExchangeRateMap singleRateMap(Currency source,
      Currency target, DateTime date, BigDecimal rate) {
    CurrencyExchangeRateMap map = new CurrencyExchangeRateMap();
    map.addExchangeRate(source, target, date, rate);
    return map;
  }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

  public static class Getting_An_Identity_Rate {
    private CurrencyExchangeRateMap rates;
   
    @Before
    public void setRates() {
      this.rates = new CurrencyExchangeRateMap();
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

    private CurrencyExchangeRateMap rates;
   

    @Before
    public void setRates() {
      this.rates = new CurrencyExchangeRateMap();
      this.rates.addExchangeRate(USD, EUR, dec31st, lowDollarToEuroRate);
      this.rates.addExchangeRate(USD, EUR, jan2nd, highDollarToEuroRate);
    }
View Full Code Here

Examples of com.wesabe.api.util.money.CurrencyExchangeRateMap

   
    private CurrencyExchangeRateMap rates;

    @Before
    public void setRates() {
      this.rates = new CurrencyExchangeRateMap();
      this.rates.addExchangeRate(USD, EUR, jun14th, lowDollarToEuroRate);
      this.rates.addExchangeRate(USD, EUR, jun17th, highDollarToEuroRate);
    }
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.