diff --git a/Tests/Common/Util/CurrencyPairUtilTests.cs b/Tests/Common/Util/CurrencyPairUtilTests.cs index d8b996ca2007..e13981d0bbc5 100644 --- a/Tests/Common/Util/CurrencyPairUtilTests.cs +++ b/Tests/Common/Util/CurrencyPairUtilTests.cs @@ -16,6 +16,8 @@ using System; using NUnit.Framework; using QuantConnect.Util; +using static QuantConnect.Util.CurrencyPairUtil; + namespace QuantConnect.Tests.Common.Util { @@ -52,6 +54,18 @@ public void IsDecomposableWorksCorrectly(Symbol symbol, bool expectedResult) Assert.AreEqual(expectedResult, CurrencyPairUtil.IsDecomposable(symbol)); } + [Test] + public void CurrencyPairMatchComparisonLogic() + { + var symbol = Symbol.Create("CHNTUSD", SecurityType.Crypto, Market.Bitfinex); + var result = CurrencyPairUtil.ComparePair(symbol, "CHN", "TUSD"); + Assert.AreEqual(result, Match.NoMatch); + result = CurrencyPairUtil.ComparePair(symbol, "CHNT", "USD"); + Assert.AreEqual(result, Match.ExactMatch); + result = CurrencyPairUtil.ComparePair(symbol, "USD", "CHNT"); + Assert.AreEqual(result, Match.InverseMatch); + } + [Test] public void CurrencyPairDualForex() {