Skip to content

Commit

Permalink
add test: TestSpotPublicWsClientAggTrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dwdwow committed Oct 7, 2024
1 parent c541c26 commit fda47dd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bnc/ws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@ func TestSpotPublicWsClient(t *testing.T) {
}
}

func TestSpotPublicWsClientAggTrade(t *testing.T) {
ws := NewWsClient(SpotPublicWsCfg, nil, nil)
err := ws.Start()
props.PanicIfNotNil(err)
err = ws.SubAggTradeStream("BTCUSDT")
props.PanicIfNotNil(err)
sub, err := ws.SubAggTrade("BTCUSDT")
props.PanicIfNotNil(err)
for {
msg := <-sub.Chan()
if msg.Err != nil {
t.Error(msg.Err)
break
}
t.Logf("%+v", msg.Data)
}
}

func TestUmFuturesPublicWsClient(t *testing.T) {
ws := NewWsClient(UmFuturesWsCfg, nil, nil)
err := ws.start()
Expand Down

0 comments on commit fda47dd

Please sign in to comment.