message_test.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package esports
  2. import (
  3. "testing"
  4. mdlesp "go-common/app/job/main/web-goblin/model/esports"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestEsportsSendMessage(t *testing.T) {
  8. var (
  9. mids = []int64{}
  10. msg = "2018 LPL 春季赛 中,你订阅的赛程“2018-01-25 19:00 RNG VS SNG”即将开播,快前去观看比赛吧! 点击前往直播间"
  11. contest = &mdlesp.Contest{}
  12. )
  13. mids = append(mids, 111)
  14. mids = append(mids, 222)
  15. convey.Convey("SendMessage", t, func(ctx convey.C) {
  16. err := d.SendMessage(mids, msg, contest)
  17. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  18. ctx.So(err, convey.ShouldBeNil)
  19. })
  20. })
  21. }
  22. func TestEsportsBatch(t *testing.T) {
  23. var (
  24. list = []int64{}
  25. msg = ""
  26. contest = &mdlesp.Contest{}
  27. batchSize = int(0)
  28. f func(users []int64, msg string, contest *mdlesp.Contest) error
  29. )
  30. convey.Convey("Batch", t, func(ctx convey.C) {
  31. d.Batch(list, msg, contest, batchSize, f)
  32. ctx.Convey("No return values", func(ctx convey.C) {
  33. })
  34. })
  35. }