likes_test.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package service
  2. import (
  3. "context"
  4. "fmt"
  5. "go-common/app/admin/main/activity/model"
  6. "testing"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestService_LikesByLid(t *testing.T) {
  10. Convey("like get items", t, WithService(func(s *Service) {
  11. res, err := s.LikesList(context.Background(), &model.LikesParam{Sid: 10256, PageSize: 10, Page: 1, Mid: 155551800, States: []int{0, 1}})
  12. So(err, ShouldBeEmpty)
  13. for _, v := range res.Likes {
  14. fmt.Printf("%+v", v)
  15. }
  16. }))
  17. }
  18. func TestService_Likes(t *testing.T) {
  19. Convey("like get items", t, WithService(func(s *Service) {
  20. res, err := s.Likes(context.Background(), 10256, []int64{1185, 1256})
  21. So(err, ShouldBeEmpty)
  22. for _, v := range res {
  23. fmt.Printf("%+v", v)
  24. }
  25. }))
  26. }
  27. func TestService_UpLike(t *testing.T) {
  28. Convey("like get items", t, WithService(func(s *Service) {
  29. res, err := s.AddLike(context.Background(), &model.AddLikes{DealType: "videoAdd", Sid: 10206, Wid: 10210488, Mid: 88895364, Device: 11, Plat: 12, State: 1, Type: 12})
  30. So(err, ShouldBeEmpty)
  31. fmt.Printf("%+v", res)
  32. }))
  33. }
  34. func TestService_UpLikeContents(t *testing.T) {
  35. Convey("like get items", t, WithService(func(s *Service) {
  36. res, err := s.UpLike(context.Background(), &model.UpLike{Lid: 13557, Type: 13, State: 1, Message: "ii", Reply: "nono", Image: "jj", Link: "like", Mid: 12345, Wid: 12367, StickTop: 1}, "ly")
  37. So(err, ShouldBeEmpty)
  38. fmt.Printf("%+v", res)
  39. }))
  40. }
  41. func TestService_BatchLikes(t *testing.T) {
  42. Convey("like get items", t, WithService(func(s *Service) {
  43. err := s.BatchLikes(context.Background(), &model.BatchLike{Sid: 10299, Type: 13, Mid: 12345, Wid: []int64{1, 4, 5, 6, 7}})
  44. So(err, ShouldBeEmpty)
  45. }))
  46. }