From 792318bfc9f917133349338c1ba2b13f9d00abd1 Mon Sep 17 00:00:00 2001 From: Matheus Klauck Date: Tue, 14 Dec 2021 16:33:28 -0300 Subject: [PATCH] [FIX] [Bitfinex] Fixed market symbol separator (#699) (#707) --- .../API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs | 2 +- tests/ExchangeSharpTests/ExchangeBitfinexTests.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs b/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs index 40233ab9..4f7190a0 100644 --- a/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Bitfinex/ExchangeBitfinexAPI.cs @@ -62,7 +62,7 @@ private ExchangeBitfinexAPI() ["ZEC"] = "zcash", }; - MarketSymbolSeparator = string.Empty; + MarketSymbolSeparator = ":"; } public override string PeriodSecondsToString(int seconds) diff --git a/tests/ExchangeSharpTests/ExchangeBitfinexTests.cs b/tests/ExchangeSharpTests/ExchangeBitfinexTests.cs index fd358344..71e6b40f 100644 --- a/tests/ExchangeSharpTests/ExchangeBitfinexTests.cs +++ b/tests/ExchangeSharpTests/ExchangeBitfinexTests.cs @@ -14,6 +14,8 @@ The above copyright notice and this permission notice shall be included in all c using ExchangeSharp; using System.Net; using System.Security; +using System; +using FluentAssertions; namespace ExchangeSharpTests { @@ -40,5 +42,16 @@ public void SubmitStopMarginOrder() api.PublicApiKey = _pubKey; ExchangeOrderResult result = api.PlaceOrderAsync(order).Result; } + + [TestMethod] + public void GetDataFromMarketWithSpecialChar() + { + IExchangeAPI api = ExchangeAPI.GetExchangeAPIAsync("Bitfinex").Result; + string marketTicker = "DOGE:USD"; + DateTime start = new DateTime(2021, 12, 1); + DateTime end = DateTime.Today; + System.Collections.Generic.IEnumerable result = api.GetCandlesAsync(marketTicker, 86400, start, end, 1000).Result; + result.Should().HaveCountGreaterThan(0, "Returned data"); + } } }