extra_func_test.go 936 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package service
  2. import (
  3. "context"
  4. "encoding/json"
  5. "testing"
  6. "go-common/app/job/main/credit/model"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func Test_DelOrigin(t *testing.T) {
  10. var (
  11. c = context.TODO()
  12. mr = &model.Case{}
  13. )
  14. mr.OriginType = int64(model.OriginTag)
  15. mr.RelationID = "57-4052400"
  16. Convey("should return err be nil", t, func() {
  17. s.DelOrigin(c, mr)
  18. })
  19. }
  20. func Test_DelOrigin2(t *testing.T) {
  21. var (
  22. c = context.TODO()
  23. mr = &model.Case{}
  24. )
  25. mr.OriginType = int64(model.OriginReply)
  26. mr.RelationID = "111002543-3-400"
  27. Convey("should return err be nil", t, func() {
  28. s.DelOrigin(c, mr)
  29. })
  30. }
  31. func TestServiceDelJuryInfoCache(t *testing.T) {
  32. var (
  33. c = context.TODO()
  34. mr = &model.Jury{}
  35. )
  36. mr.ID = 304
  37. mr.Status = model.CaseStatusDealing
  38. mr.Mid = 1
  39. Convey("should return err be nil", t, func() {
  40. b, _ := json.Marshal(&mr)
  41. err := s.DelJuryInfoCache(c, b)
  42. So(err, ShouldBeNil)
  43. })
  44. }