Package com.xeiam.xchange.btcchina.dto.trade.response

Source Code of com.xeiam.xchange.btcchina.dto.trade.response.BTCChinaGetIcebergOrderResponseTest

package com.xeiam.xchange.btcchina.dto.trade.response;

import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.math.BigDecimal;

import org.junit.Test;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.xeiam.xchange.btcchina.dto.trade.BTCChinaIcebergOrder;
import com.xeiam.xchange.btcchina.dto.trade.BTCChinaOrder;

public class BTCChinaGetIcebergOrderResponseTest {

  private final ObjectMapper mapper = new ObjectMapper();

  @Test
  public void testBTCChinaGetIcebergOrderResponse() throws IOException {

    BTCChinaGetIcebergOrderResponse response = mapper.readValue(getClass().getResource("getIcebergOrder.json"), BTCChinaGetIcebergOrderResponse.class);
    BTCChinaIcebergOrder io = response.getResult().getIcebergOrder();
    assertEquals(1, io.getId());
    assertEquals("bid", io.getType());
    assertEquals(new BigDecimal("40.00"), io.getPrice());
    assertEquals("BTCCNY", io.getMarket());
    assertEquals(new BigDecimal("12.00000000"), io.getAmount());
    assertEquals(new BigDecimal("12.00000000"), io.getAmountOriginal());
    assertEquals(new BigDecimal("5.00000000"), io.getDisclosedAmount());
    assertEquals(new BigDecimal("0.10"), io.getVariance());
    assertEquals(1405412126L, io.getDate());
    assertEquals("open", io.getStatus());

    BTCChinaOrder o = io.getOrders()[0];
    assertEquals(3301L, o.getId());
    assertEquals("bid", o.getType());
    assertEquals(new BigDecimal("40.00"), o.getPrice());
    assertEquals("CNY", o.getCurrency());
    assertEquals(new BigDecimal("4.67700000"), o.getAmount());
    assertEquals(new BigDecimal("4.67700000"), o.getAmountOriginal());
    assertEquals(1405412126L, o.getDate());
    assertEquals("open", o.getStatus());
  }

}
TOP

Related Classes of com.xeiam.xchange.btcchina.dto.trade.response.BTCChinaGetIcebergOrderResponseTest

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.