You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
836 B
33 lines
836 B
package dao |
|
|
|
import ( |
|
"context" |
|
"go-common/app/admin/main/vip/model" |
|
"testing" |
|
|
|
"github.com/smartystreets/goconvey/convey" |
|
gock "gopkg.in/h2non/gock.v1" |
|
) |
|
|
|
func TestDaoSendMultipMsg(t *testing.T) { |
|
convey.Convey("SendMultipMsg", t, func() { |
|
defer gock.OffAll() |
|
httpMock("POST", _SendUserNotify).Reply(200).JSON(`{"code":0}`) |
|
err := d.SendMultipMsg(context.TODO(), "", "", "", "", "", 0) |
|
convey.So(err, convey.ShouldBeNil) |
|
}) |
|
} |
|
|
|
func TestDaoPayRefund(t *testing.T) { |
|
var ( |
|
arg = &model.PayOrder{} |
|
refundAmount float64 = 1.0 |
|
refundID = "test001" |
|
) |
|
convey.Convey("PayRefund", t, func() { |
|
defer gock.OffAll() |
|
httpMock("POST", _payRefund).Reply(200).JSON(`{"code":0}`) |
|
err := d.PayRefund(context.Background(), arg, refundAmount, refundID) |
|
convey.So(err, convey.ShouldBeNil) |
|
}) |
|
}
|
|
|