Skip to content

Commit fcbdc8f

Browse files
committed
Add unit test for currency pair match
1 parent e5e044c commit fcbdc8f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tests/Common/Util/CurrencyPairUtilTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
using System;
1717
using NUnit.Framework;
1818
using QuantConnect.Util;
19+
using static QuantConnect.Util.CurrencyPairUtil;
20+
1921

2022
namespace QuantConnect.Tests.Common.Util
2123
{
@@ -52,6 +54,18 @@ public void IsDecomposableWorksCorrectly(Symbol symbol, bool expectedResult)
5254
Assert.AreEqual(expectedResult, CurrencyPairUtil.IsDecomposable(symbol));
5355
}
5456

57+
[Test]
58+
public void CurrencyPairMatchComparisonLogic()
59+
{
60+
var symbol = Symbol.Create("CHNTUSD", SecurityType.Crypto, Market.Bitfinex);
61+
var result = CurrencyPairUtil.ComparePair(symbol, "CHN", "TUSD");
62+
Assert.AreEqual(result, Match.NoMatch);
63+
result = CurrencyPairUtil.ComparePair(symbol, "CHNT", "USD");
64+
Assert.AreEqual(result, Match.ExactMatch);
65+
result = CurrencyPairUtil.ComparePair(symbol, "USD", "CHNT");
66+
Assert.AreEqual(result, Match.InverseMatch);
67+
}
68+
5569
[Test]
5670
public void CurrencyPairDualForex()
5771
{

0 commit comments

Comments
 (0)