mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 17:13:51 +00:00
19 lines
453 B
Go
19 lines
453 B
Go
|
package ftx
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func Test_rawResponse_toSubscribedResp(t *testing.T) {
|
||
|
input := `{"type": "subscribed", "channel": "orderbook", "market": "BTC/USDT"}`
|
||
|
var m rawResponse
|
||
|
assert.NoError(t, json.Unmarshal([]byte(input), &m))
|
||
|
r := m.toSubscribedResp()
|
||
|
assert.Equal(t, subscribedRespType, r.Type)
|
||
|
assert.Equal(t, orderbook, r.Channel)
|
||
|
assert.Equal(t, "BTC/USDT", r.Market)
|
||
|
}
|