Package whitewerx.com.trapos.model

Examples of whitewerx.com.trapos.model.Rate


    @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);
        assertThat(trade, equalTo(expected));
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);
        assertThat(trade, equalTo(expected));
View Full Code Here

TOP

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

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.