File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/test/java/org/javamoney/moneta/function Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .javamoney .moneta .function ;
2+
3+ import org .javamoney .moneta .ExchangeRateBuilder ;
4+ import org .javamoney .moneta .spi .DefaultNumberValue ;
5+ import org .testng .annotations .Test ;
6+
7+ import javax .money .CurrencyUnit ;
8+ import javax .money .MonetaryCurrencies ;
9+ import javax .money .convert .ExchangeRate ;
10+ import javax .money .convert .RateType ;
11+
12+ import static org .testng .Assert .assertEquals ;
13+
14+ public class ExchangeRateSimpleTest {
15+ private static final CurrencyUnit EUR = MonetaryCurrencies .getCurrency ("EUR" );
16+ private static final CurrencyUnit GBP = MonetaryCurrencies .getCurrency ("GBP" );
17+
18+ @ Test
19+ public void equalsTest () {
20+ DefaultNumberValue factor = new DefaultNumberValue (1.1 );
21+
22+ ExchangeRate rate1 = new ExchangeRateBuilder ("myprovider" , RateType .ANY )
23+ .setBase (EUR )
24+ .setTerm (GBP )
25+ .setFactor (factor )
26+ .build ();
27+
28+ ExchangeRate rate2 = new ExchangeRateBuilder ("myprovider" , RateType .ANY )
29+ .setBase (EUR )
30+ .setTerm (GBP )
31+ .setFactor (factor )
32+ .build ();
33+
34+ assertEquals (rate1 , rate2 );
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments