mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 07:26:48 +00:00
subscriptions: Add templating support and integrate with Binance (#1568)
* Subscriptions: Add List.AssetPairs * Subscriptions: Add Template and QualifiedChannel These fields separate the concept of what the channel is from the qualified resource name * Subscriptions: Add List.SetStates() * Subscriptions: Add List.QualifiedChannels * Subscriptions: Rename testsubs.EqualLists * Binance: Switch to ExpandTemplates * Binance: Update ConfigTest format * Subscriptions: Test Coverage improvements * Subscriptions: Reenterant List.ExpandTemplates * Subscriptions: Move templates from subscriptions to exchanges * Binance: Inline subscription template and improvements
This commit is contained in:
@@ -105,6 +105,15 @@ func TestIgnoringPairsKeyMatch(t *testing.T) {
|
||||
// TestIgnoringPairsKeyString exercises IgnoringPairsKey.String
|
||||
func TestIgnoringPairsKeyString(t *testing.T) {
|
||||
t.Parallel()
|
||||
assert.Equal(t, "Uninitialised IgnoringPairsKey", IgnoringPairsKey{}.String())
|
||||
key := &IgnoringPairsKey{&Subscription{Asset: asset.Spot, Channel: TickerChannel, Pairs: currency.Pairs{ethusdcPair, btcusdtPair}}}
|
||||
assert.Equal(t, "ticker spot", key.String())
|
||||
}
|
||||
|
||||
// TestGetSubscription exercises GetSubscription
|
||||
func TestGetSubscription(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := &Subscription{Asset: asset.Spot}
|
||||
assert.Same(t, s, ExactKey{s}.GetSubscription(), "ExactKey.GetSubscription Must return a pointer to the subscription")
|
||||
assert.Same(t, s, IgnoringPairsKey{s}.GetSubscription(), "IgnorePairKeys.GetSubscription Must return a pointer to the subscription")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user