api_test.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package recommend
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. cdm "go-common/app/interface/main/app-card/model"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestRecommend(t *testing.T) {
  10. var (
  11. c = context.TODO()
  12. plat = int8(1)
  13. buvid = ""
  14. mid = int64(1)
  15. build = int(1111)
  16. loginEvent = int(0)
  17. parentMode = int(0)
  18. recsysMode = int(1)
  19. zoneID = int64(0)
  20. group = int(0)
  21. interest = ""
  22. network = ""
  23. style = int(0)
  24. column cdm.ColumnStatus
  25. flush = int(0)
  26. autoPlay = ""
  27. now time.Time
  28. )
  29. convey.Convey("Ping", t, func(ctx convey.C) {
  30. _, _, _, _, err := d.Recommend(c, plat, buvid, mid, build, loginEvent, parentMode, recsysMode, zoneID, group, interest, network, style, column, flush, autoPlay, now)
  31. ctx.Convey("Then err should not be nil.", func(ctx convey.C) {
  32. ctx.So(err, convey.ShouldNotBeNil)
  33. })
  34. })
  35. }
  36. func TestHots(t *testing.T) {
  37. var (
  38. c = context.TODO()
  39. )
  40. convey.Convey("Ping", t, func(ctx convey.C) {
  41. _, err := d.Hots(c)
  42. ctx.Convey("Then err should not be nil.", func(ctx convey.C) {
  43. ctx.So(err, convey.ShouldNotBeNil)
  44. })
  45. })
  46. }
  47. func TestTagTop(t *testing.T) {
  48. var (
  49. c = context.TODO()
  50. mid = int64(1)
  51. tid = int64(1)
  52. rn = int(0)
  53. )
  54. convey.Convey("Ping", t, func(ctx convey.C) {
  55. _, err := d.TagTop(c, mid, tid, rn)
  56. ctx.Convey("Then err should not be nil.", func(ctx convey.C) {
  57. ctx.So(err, convey.ShouldNotBeNil)
  58. })
  59. })
  60. }
  61. func TestGroup(t *testing.T) {
  62. var (
  63. c = context.TODO()
  64. )
  65. convey.Convey("Ping", t, func(ctx convey.C) {
  66. d.Group(c)
  67. })
  68. }