Package com.xeiam.xchange.btccentral.dto.marketdata

Examples of com.xeiam.xchange.btccentral.dto.marketdata.BTCCentralTicker


    // Read in the JSON from the example resources
    InputStream is = MarketDataTest.class.getResourceAsStream("/Example_TickerData.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    BTCCentralTicker btcCentralTicker = mapper.readValue(is, BTCCentralTicker.class);

    assertEquals(btcCentralTicker.getCurrency(), "EUR");
    assertEquals(btcCentralTicker.getAsk(), new BigDecimal("20.4"));
    assertEquals(btcCentralTicker.getBid(), new BigDecimal("20.1"));
    assertEquals(btcCentralTicker.getHigh(), new BigDecimal("20.74"));
    assertEquals(btcCentralTicker.getLow(), new BigDecimal("20.2"));
    assertEquals(btcCentralTicker.getPrice(), new BigDecimal("20.2"));
    assertEquals(btcCentralTicker.getVolume(), new BigDecimal("148.80193218"));

  }
View Full Code Here


    // Read in the JSON from the example resources
    InputStream is = AdaptersTest.class.getResourceAsStream("/Example_TickerData.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    BTCCentralTicker btcCentralTicker = mapper.readValue(is, BTCCentralTicker.class);

    Ticker genericTicker = BTCCentralAdapters.adaptTicker(btcCentralTicker, CurrencyPair.BTC_EUR);

    assertEquals(genericTicker.getAsk(), new BigDecimal("20.4"));
    assertEquals(genericTicker.getBid(), new BigDecimal("20.1"));
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.btccentral.dto.marketdata.BTCCentralTicker

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.