Skip to content

Commit c8bfd98

Browse files
committed
Added test cases for currency pair comparison
1 parent fcbdc8f commit c8bfd98

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Tests/Common/Util/CurrencyPairUtilTests.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,14 @@ public void IsDecomposableWorksCorrectly(Symbol symbol, bool expectedResult)
5454
Assert.AreEqual(expectedResult, CurrencyPairUtil.IsDecomposable(symbol));
5555
}
5656

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);
57+
[TestCase("CHNTUSD", "CHN", "TUSD", Match.NoMatch)]
58+
[TestCase("CHNTUSD", "CHNT", "USD", Match.ExactMatch)]
59+
[TestCase("CHNTUSD", "USD", "CHNT", Match.InverseMatch)]
60+
public void CurrencyPairMatchComparisonLogic(string symbolValue, string baseCurrency, string quoteCurrency, Match expectedResult)
61+
{
62+
var symbol = Symbol.Create(symbolValue, SecurityType.Crypto, Market.Bitfinex);
63+
var result = CurrencyPairUtil.ComparePair(symbol, baseCurrency, quoteCurrency);
64+
Assert.AreEqual(expectedResult, result);
6765
}
6866

6967
[Test]

0 commit comments

Comments
 (0)