예제 #1
0
        public void BooksClientTest()
        {
            var client = new BitfinexRestClient();
            var books  = client.GetBooks("tBTCUSD", Precision.P0, 5);

            Assert.AreEqual(10, books.Count);
        }
예제 #2
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");
         }
     }
 }
예제 #3
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'");
                }
            }
        }