Skip to content

Commit

Permalink
Add unit test for currency pair match
Browse files Browse the repository at this point in the history
  • Loading branch information
JosueNina committed Jan 10, 2025
1 parent e5e044c commit fcbdc8f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Tests/Common/Util/CurrencyPairUtilTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using System;
using NUnit.Framework;
using QuantConnect.Util;
using static QuantConnect.Util.CurrencyPairUtil;


namespace QuantConnect.Tests.Common.Util
{
Expand Down Expand Up @@ -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()
{
Expand Down

0 comments on commit fcbdc8f

Please sign in to comment.