use of org.knowm.xchange.btcturk.dto.marketdata.BTCTurkOrderBook in project XChange by knowm.
the class MarketDataFetchIntegration method Tests.
@Test
public void Tests() throws Exception, InterruptedException {
// Ticker Test
Thread.sleep(1000);
Ticker ticker = btcTurkMarketDataService.getTicker(new CurrencyPair("BTC", "TRY"));
System.out.println(ticker.toString());
assertThat(ticker).isNotNull();
Thread.sleep(1000);
List<Ticker> tickers = btcTurkMarketDataService.getTickers(new Params() {
});
for (Ticker _ticker : tickers) {
System.out.println(_ticker.toString());
assertThat(_ticker).isNotNull();
}
Thread.sleep(1000);
// TradesTest
Trades trades = btcTurkMarketDataService.getTrades(CurrencyPair.BTC_TRY);
assertThat(trades.getTrades().size()).isEqualTo(50);
Thread.sleep(1000);
trades = btcTurkMarketDataService.getTrades(CurrencyPair.BTC_TRY, 5);
assertThat(trades.getTrades().size()).isEqualTo(5);
Thread.sleep(1000);
// OHCLTest
List<BTCTurkOHLC> btcTurkBTCTurkOHLC = btcTurkMarketDataService.getBTCTurkOHLC(CurrencyPair.BTC_TRY);
// Daily size is always changing
assertThat(btcTurkBTCTurkOHLC.size()).isNotEqualTo(0);
Thread.sleep(1000);
List<BTCTurkOHLC> btcTurkBTCTurkOHLC2 = btcTurkMarketDataService.getBTCTurkOHLC(CurrencyPair.BTC_TRY, 2);
assertThat(btcTurkBTCTurkOHLC2.size()).isEqualTo(2);
// OrderBookTest
Thread.sleep(1000);
BTCTurkOrderBook btcTurkBTCTurkOrderBook = btcTurkMarketDataService.getBTCTurkOrderBook(CurrencyPair.BTC_TRY);
assertThat(btcTurkBTCTurkOrderBook.getAsks().size()).isEqualTo(100);
assertThat(btcTurkBTCTurkOrderBook.getBids().size()).isEqualTo(100);
}
Aggregations