mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 07:15:15 +00:00
e2ab363e64
Signed-off-by: c9s <yoanlin93@gmail.com>
30 lines
492 B
Go
30 lines
492 B
Go
package dynamic
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
type callTest struct {
|
|
ChildCall1 *childCall1
|
|
ChildCall2 *childCall2
|
|
}
|
|
|
|
type childCall1 struct{}
|
|
|
|
func (c *childCall1) Subscribe(a int) {}
|
|
|
|
type childCall2 struct{}
|
|
|
|
func (c *childCall2) Subscribe(a int) {}
|
|
|
|
func TestCallStructFieldsMethod(t *testing.T) {
|
|
c := &callTest{
|
|
ChildCall1: &childCall1{},
|
|
ChildCall2: &childCall2{},
|
|
}
|
|
err := CallStructFieldsMethod(c, "Subscribe", 10)
|
|
assert.NoError(t, err)
|
|
}
|