Exemplo n.º 1
0
        public void OkCoinSellCostRoundTest()
        {
            OkCoin okcoin = new OkCoin();

            Assert.IsTrue(okcoin.ApplyFeeToSellCost(0.01m * 430.63m) == 4.2976m);
            Assert.IsTrue(okcoin.ApplyFeeToSellCost(0.014m * 371.76m) == 5.1941m);
        }
Exemplo n.º 2
0
        public void OkCoinBalanceUpdateTest()
        {
            OkCoin okCoin = new OkCoin();

            //If there is any problem connecting to the exchange, this will throw an error.
            okCoin.UpdateBalances();
        }
Exemplo n.º 3
0
        public void OkCoinUpdateOrderBookTest()
        {
            OkCoin okCoin = new OkCoin();

            //If there is any problem connecting to the exchange, this will throw an error.
            okCoin.UpdateOrderBook(1);

            //This assumes that the exchange has at least 1 order on each side. Technically this can give a false negative, but it's unlikely.
            Assert.IsTrue(okCoin.OrderBook.Asks.Count == 1);
            Assert.IsTrue(okCoin.OrderBook.Bids.Count == 1);
        }
Exemplo n.º 4
0
        public void OkCoinSellQueryDeleteTest()
        {
            OkCoin okCoin = new OkCoin();
            string sellorderId;

            //First, insert a sell order. If there are any errors with either of these operations,
            //an exception will be thrown.

            //Buy at a really low price to the order doesn't actually get executed.
            sellorderId = okCoin.Sell(okCoin.MinimumBitcoinOrderAmount, 999m);

            //Both orders should still be open
            Assert.IsFalse(okCoin.IsOrderFulfilled(sellorderId));

            //Now delete the order. If there is an error, an exception will be thrown.
            okCoin.DeleteOrder(sellorderId);
        }
Exemplo n.º 5
0
        public void OkCoinGetAllOpenOrdersTest()
        {
            OkCoin okcoin = new OkCoin();

            object result = okcoin.GetAllOpenOrders();
        }