go-common/app/job/main/web-goblin/dao/esports/message_test.go
2019-04-22 18:49:16 +08:00

41 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package esports
import (
"testing"
mdlesp "go-common/app/job/main/web-goblin/model/esports"
"github.com/smartystreets/goconvey/convey"
)
func TestEsportsSendMessage(t *testing.T) {
var (
mids = []int64{}
msg = "2018 LPL 春季赛 中你订阅的赛程“2018-01-25 19:00 RNG VS SNG”即将开播快前去观看比赛吧 点击前往直播间"
contest = &mdlesp.Contest{}
)
mids = append(mids, 111)
mids = append(mids, 222)
convey.Convey("SendMessage", t, func(ctx convey.C) {
err := d.SendMessage(mids, msg, contest)
ctx.Convey("Then err should be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldBeNil)
})
})
}
func TestEsportsBatch(t *testing.T) {
var (
list = []int64{}
msg = ""
contest = &mdlesp.Contest{}
batchSize = int(0)
f func(users []int64, msg string, contest *mdlesp.Contest) error
)
convey.Convey("Batch", t, func(ctx convey.C) {
d.Batch(list, msg, contest, batchSize, f)
ctx.Convey("No return values", func(ctx convey.C) {
})
})
}