Ejemplo n.º 1
0
        public void CandlesClientSectionHistoricalTest()
        {
            var client  = new BitfinexRestClient();
            var candles = client.GetCandles(TimeFrame.Minute, Symbol.BTCUSD, Section.Historical);

            Assert.IsTrue(candles.Count > 1);
        }
Ejemplo n.º 2
0
        public void BooksClientTest()
        {
            var client = new BitfinexRestClient();
            var books  = client.GetBooks("tBTCUSD", Precision.P0, 5);

            Assert.AreEqual(10, books.Count);
        }
Ejemplo n.º 3
0
        public void CandlesClientSectionLastTest()
        {
            var client  = new BitfinexRestClient();
            var candles = client.GetCandles(TimeFrame.Minute, Symbol.BTCUSD, Section.Last);

            Assert.AreEqual(1, candles.Count);
        }
Ejemplo n.º 4
0
        public void TradesClientTest2()
        {
            var client = new BitfinexRestClient();
            var trades = client.GetTrades("tBTCUSD", 120, 1501105149000, 1501115149000, SortDirection.NewestToOldest);

            Assert.AreEqual(120, trades.Count);
        }
Ejemplo n.º 5
0
        public void TradesClientTest()
        {
            var client = new BitfinexRestClient();
            var trades = client.GetTrades("tBTCUSD", 50, 0, 0, SortDirection.NewestToOldest);

            Assert.AreEqual(50, trades.Count);
        }
Ejemplo n.º 6
0
        public void TickerClientTest()
        {
            var client = new BitfinexRestClient();
            var ticker = client.GetTicker("tBTCUSD");

            Assert.AreEqual("BTCUSD", ticker.Symbol);
        }
Ejemplo n.º 7
0
        public void StatsClientSectionHistoricalTest()
        {
            var client = new BitfinexRestClient();
            var stats  = client.GetStats(Key.TotalOpenPosition, Symbol.BTCUSD, Side.Long, Section.Historical, SortDirection.OldestToNewest);

            Assert.IsTrue(stats.Count > 1);
        }
Ejemplo n.º 8
0
        public void StatsClientSectionLastTest()
        {
            var client = new BitfinexRestClient();
            var stats  = client.GetStats(Key.TotalOpenPosition, Symbol.BTCUSD, Side.Long, Section.Last, SortDirection.OldestToNewest);

            Assert.AreEqual(1, stats.Count);
        }
Ejemplo n.º 9
0
 public void BooksClientWrongSymbolTest()
 {
     try
     {
         var client = new BitfinexRestClient();
         client.GetBooks("fUSD", Precision.P0, 5);
     }
     catch (Exception ex)
     {
         if (ex.InnerException != null)
         {
             Assert.AreEqual(ex.InnerException.Message, "(10020) symbol: invalid");
         }
     }
 }
Ejemplo n.º 10
0
        public void BooksClientIncorrectEndpointTest()
        {
            try
            {
                var client = new BitfinexRestClient {
                    BaseUrl = "https://api.bitfinexf.com/v2"
                };

                client.GetBooks("fUSD", Precision.P0, 5);
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    Assert.AreEqual(ex.InnerException.Message,
                                    "The remote name could not be resolved: 'api.bitfinexf.com'");
                }
            }
        }