send_test.go 836 B

123456789101112131415161718192021222324252627282930313233
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/admin/main/vip/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. gock "gopkg.in/h2non/gock.v1"
  8. )
  9. func TestDaoSendMultipMsg(t *testing.T) {
  10. convey.Convey("SendMultipMsg", t, func() {
  11. defer gock.OffAll()
  12. httpMock("POST", _SendUserNotify).Reply(200).JSON(`{"code":0}`)
  13. err := d.SendMultipMsg(context.TODO(), "", "", "", "", "", 0)
  14. convey.So(err, convey.ShouldBeNil)
  15. })
  16. }
  17. func TestDaoPayRefund(t *testing.T) {
  18. var (
  19. arg = &model.PayOrder{}
  20. refundAmount float64 = 1.0
  21. refundID = "test001"
  22. )
  23. convey.Convey("PayRefund", t, func() {
  24. defer gock.OffAll()
  25. httpMock("POST", _payRefund).Reply(200).JSON(`{"code":0}`)
  26. err := d.PayRefund(context.Background(), arg, refundAmount, refundID)
  27. convey.So(err, convey.ShouldBeNil)
  28. })
  29. }