airobot/test/robot_test.go
2022-12-09 18:41:12 +08:00

35 lines
537 B
Go

package test
import (
"testing"
"legu.airobot/busi/friend"
"legu.airobot/lib"
)
func TestAction(t *testing.T) {
ai := lib.NewAI()
//注册caller
ai.InitCaller(
&friend.FriendRecommend{Desc: "好友推荐"},
)
// 创建场景
scene := lib.NewScene(ai, lib.SceneParam{
Name: "场景1",
Desc: "好友",
})
//为场景选择caller
scene.AddCaller(&friend.FriendRecommend{Desc: "好友推荐"})
//加机器人
ai.AddRobots(1, scene)
//运行机器人
for _, v := range ai.GetRobots("场景1") {
v.Start()
}
}