reply_test.go 748 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/job/main/credit/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func Test_addReplyReport(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. mr = &model.Reply{
  12. Subject: &model.ReplySubject{
  13. OID: 2222,
  14. },
  15. Reply: &model.ReplyMain{
  16. Like: 1,
  17. MID: 27515628,
  18. Content: &struct {
  19. Message string `json:"message"`
  20. }{Message: "xxxx"},
  21. },
  22. Report: &model.ReplyReport{
  23. State: model.ReportStateNew,
  24. Type: model.SubTypeArchive,
  25. Reason: model.ReplyReasonGarbageAds,
  26. Score: 2,
  27. RPID: 1111,
  28. OID: 2222,
  29. },
  30. }
  31. )
  32. Convey("should return err be nil", t, func() {
  33. err := s.addReplyReport(c, mr)
  34. So(err, ShouldBeNil)
  35. })
  36. }