blocked_test.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package service
  2. import (
  3. "context"
  4. "encoding/json"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. // TestBatchBLKInfos .
  9. func TestBatchBLKInfos(t *testing.T) {
  10. Convey("TestBatchBLKInfos", t, func() {
  11. res, err := s.BatchBLKInfos(context.TODO(), []int64{1111, 222})
  12. So(err, ShouldBeNil)
  13. out, err := json.Marshal(res)
  14. So(err, ShouldBeNil)
  15. So(out, ShouldNotBeNil)
  16. })
  17. }
  18. // TestBlockedUserCard .
  19. func TestBlockedUserCard(t *testing.T) {
  20. Convey("TestBlockedUserCard", t, func() {
  21. res, err := s.BlockedUserCard(context.TODO(), 21432418)
  22. So(err, ShouldBeNil)
  23. out, err := json.Marshal(res)
  24. So(err, ShouldBeNil)
  25. So(out, ShouldNotBeNil)
  26. })
  27. }
  28. // TestBlockedUserList .
  29. func TestBlockedUserList(t *testing.T) {
  30. Convey("TestBlockedUserList", t, func() {
  31. res, err := s.BlockedUserList(context.TODO(), 1)
  32. So(err, ShouldBeNil)
  33. out, err := json.Marshal(res)
  34. So(err, ShouldBeNil)
  35. So(out, ShouldNotBeNil)
  36. })
  37. }
  38. // TestBlockedInfo .
  39. func TestBlockedInfo(t *testing.T) {
  40. Convey("TestBlockedInfo", t, func() {
  41. res, err := s.BlockedInfo(context.TODO(), 1475)
  42. So(err, ShouldBeNil)
  43. out, err := json.Marshal(res)
  44. So(err, ShouldBeNil)
  45. So(out, ShouldNotBeNil)
  46. })
  47. }
  48. // TestBlockedList .
  49. func TestBlockedList(t *testing.T) {
  50. Convey("TestBlockedList", t, func() {
  51. res, err := s.BlockedList(context.TODO(), 0, -1, 1, 5)
  52. So(err, ShouldBeNil)
  53. out, err := json.Marshal(res)
  54. So(err, ShouldBeNil)
  55. So(out, ShouldNotBeNil)
  56. })
  57. }
  58. // TestAnnouncementInfo .
  59. func TestAnnouncementInfo(t *testing.T) {
  60. Convey("TestAnnouncementInfo", t, func() {
  61. s.LoadAnnouncement(context.TODO())
  62. res, err := s.AnnouncementInfo(context.TODO(), 48)
  63. So(err, ShouldBeNil)
  64. out, err := json.Marshal(res)
  65. So(err, ShouldBeNil)
  66. So(out, ShouldNotBeNil)
  67. })
  68. }
  69. // TestAnnouncementList .
  70. func TestAnnouncementList(t *testing.T) {
  71. Convey("TestAnnouncementList", t, func() {
  72. s.LoadAnnouncement(context.TODO())
  73. res, err := s.AnnouncementList(context.TODO(), 1, 1, 3)
  74. So(err, ShouldBeNil)
  75. out, err := json.Marshal(res)
  76. So(err, ShouldBeNil)
  77. So(out, ShouldNotBeNil)
  78. })
  79. }