Ejemplo n.º 1
0
        public void StartServer()
        {
            var host = new AppHost();

            var startTime = DateTime.Now;

            host.Start();

            Thread.Sleep(2 * 60 * 1000);

            IExchangeRepertory client = new ExchangeRepertory();
            var rate = client.GetTodayRates();

            Assert.IsTrue(rate[0].LastChangeTime.ToFileTimeUtc() > startTime.ToFileTimeUtc(), "Rate error.");

            IKrakenRepertory krakenClient = new KrakenRepertory();
            var ticker = krakenClient.GetTicker();

            Assert.IsTrue(ticker[0].LastChangeTime.ToFileTimeUtc() > startTime.ToFileTimeUtc(), "Ticker error.");

            var balance = krakenClient.GetBalance();

            Assert.IsTrue(balance[0].LastChangeTime.ToFileTimeUtc() > startTime.ToFileTimeUtc(), "Balance error.");

            var booking = krakenClient.GetBooking("BTC");

            Assert.IsTrue(booking[0].LastChangeTime.ToFileTimeUtc() > startTime.ToFileTimeUtc(), "Booking error.");

            host.Dispose();
        }
Ejemplo n.º 2
0
        public void GetKrakenBalances()
        {
            IKrakenRepertory client = new KrakenRepertory();

            var balance = client.GetBalance();

            Assert.IsNotNull(balance, "Balance error.");
            Assert.IsTrue(balance.Count > 0, "Balance emty");
        }