public void TestParseBterGetFunds() { JObject fundsJson = LoadTestData <JObject>("getfunds.json"); List <Wallet> wallets = BterParsers.ParseWallets(fundsJson); Assert.AreEqual(5, wallets.Count); Assert.AreEqual("CNY", wallets[0].CurrencyCode); Assert.AreEqual(1122.16m, wallets[0].Balance); Assert.AreEqual(0.0m, wallets[0].HeldBalance); Assert.AreEqual("BTC", wallets[1].CurrencyCode); Assert.AreEqual(0.83357671m, wallets[1].Balance); Assert.AreEqual(0.0002m, wallets[1].HeldBalance); }
public void TestParseBterOrderBook() { JObject orderBookJson = LoadTestData <JObject>("depth_doge_btc.json"); Book orderBook = BterParsers.ParseOrderBook(orderBookJson); List <MarketDepth> asks = orderBook.Asks; List <MarketDepth> bids = orderBook.Bids; Assert.AreEqual(asks[0].Price, (decimal)0.00000238); Assert.AreEqual(asks[0].Quantity, (decimal)220397.66873897); Assert.AreEqual(asks[1].Price, (decimal)0.00000237); Assert.AreEqual(asks[1].Quantity, (decimal)2833885.131); Assert.AreEqual(bids[0].Price, (decimal)0.00000228); Assert.AreEqual(bids[0].Quantity, (decimal)69517.54691671); Assert.AreEqual(bids[1].Price, (decimal)0.00000227); Assert.AreEqual(bids[1].Quantity, (decimal)540711.166); }