Package whitewerx.com.trapos.model

Examples of whitewerx.com.trapos.model.Currency


        String ccy1 = m.group(CCY1);
        String ccy2 = m.group(CCY2);
        double atRate = Double.valueOf(m.group(RATE));
       
        Rate rate = new Rate(atRate, new CurrencyPair(new Currency(ccy1), new Currency(ccy2)));
        if(l.isTraceEnabled())
            l.trace(delimitedRate +"->" + rate);
       
        return rate;
    }
View Full Code Here


     */
    @Test
    public void translatesATradeMessage() throws Exception {
        String delimitedTrade = "T|B|5.1t|R|EURUSD|1.3124";
       
        Amount fivePointOneThousand = new Amount(5.1 * 1000, new Currency("EUR"));
        Rate atEURUSDRate = new Rate(1.3124, EURUSD);
        final Trade expected = new Trade(TradeType.BUY, fivePointOneThousand, atEURUSDRate);
       
        TradeTranslator t = new TradeTranslator();
        Trade trade = t.translate(delimitedTrade);
View Full Code Here

    @Test
    public void translatesATradeMessageWithNoMultiplier() throws Exception {
        String delimitedTrade = "T|S|5.1|R|EURUSD|1.3124";
       
        Amount fivePointOne = new Amount(5.1, new Currency("EUR"));
        Rate atEURUSDRate = new Rate(1.3124, EURUSD);
        final Trade expected = new Trade(TradeType.SELL, fivePointOne, atEURUSDRate);
       
        TradeTranslator t = new TradeTranslator();
        Trade trade = t.translate(delimitedTrade);
View Full Code Here

   
    @Test
    public void translatesATradeMessageMillionsMultiplier() throws Exception {
        String delimitedTrade = "T|S|2m|R|USDCAD|1.0012";
       
        Amount twoMillion = new Amount(2000000.0, new Currency("USD"));
        Rate atUSDCADRate = new Rate(1.0012, USDCAD);
        final Trade expected = new Trade(TradeType.SELL, twoMillion, atUSDCADRate);
       
        TradeTranslator t = new TradeTranslator();
        Trade trade = t.translate(delimitedTrade);
View Full Code Here

TOP

Related Classes of whitewerx.com.trapos.model.Currency

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.