mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
29 lines
534 B
Go
29 lines
534 B
Go
|
package bbgo
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
type myStrategy struct {
|
||
|
Symbol string `json:"symbol"`
|
||
|
}
|
||
|
|
||
|
func (m myStrategy) ID() string {
|
||
|
return "mystrategy"
|
||
|
}
|
||
|
|
||
|
func (m *myStrategy) Run(ctx context.Context, orderExecutor OrderExecutor, session *ExchangeSession) error {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func Test_getStrategySignature(t *testing.T) {
|
||
|
signature, err := getStrategySignature(&myStrategy{
|
||
|
Symbol: "BTCUSDT",
|
||
|
})
|
||
|
assert.NoError(t, err)
|
||
|
assert.Equal(t, "bbgo.mystrategy.BTCUSDT", signature)
|
||
|
}
|