package mobi.boilr.libdynticker.exchanges;
import java.io.File;
import java.io.IOException;
import mobi.boilr.libdynticker.core.ExchangeTest;
import mobi.boilr.libdynticker.core.Pair;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class CoinMateExchangeTest extends ExchangeTest {
@Override
@Before
public void setUp() throws Exception {
testExchange = new CoinMateExchange(1000);
}
@Override
@After
public void tearDown() throws Exception {}
@Test
public void testParseTicker() {
try {
Pair pair = new Pair("BTC", "USD");
JsonNode node = (new ObjectMapper().readTree(new File("src/test/json/coinmate-ticker.json")));
String lastValue = testExchange.parseTicker(node, pair);
Assert.assertEquals("287.61", lastValue);
} catch(IOException e) {
Assert.fail();
}
}
}