push_test.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 TestEsportsNoticeUser(t *testing.T) {
  8. var (
  9. mids = []int64{11, 22, 33}
  10. body = ""
  11. contest = &mdlesp.Contest{}
  12. )
  13. convey.Convey("NoticeUser", t, func(ctx convey.C) {
  14. err := d.NoticeUser(mids, body, contest)
  15. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. })
  18. })
  19. }
  20. func TestEsportssignature(t *testing.T) {
  21. var (
  22. params map[string]string
  23. secret = ""
  24. )
  25. convey.Convey("signature", t, func(ctx convey.C) {
  26. p1 := d.signature(params, secret)
  27. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  28. ctx.So(p1, convey.ShouldNotBeNil)
  29. })
  30. })
  31. }
  32. func TestEsportsgetUUID(t *testing.T) {
  33. var (
  34. mids = "11,22,33"
  35. contest = &mdlesp.Contest{}
  36. )
  37. convey.Convey("getUUID", t, func(ctx convey.C) {
  38. p1 := d.getUUID(mids, contest)
  39. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  40. ctx.So(p1, convey.ShouldNotBeNil)
  41. })
  42. })
  43. }