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.
42 lines
1018 B
42 lines
1018 B
package dao |
|
|
|
import ( |
|
"context" |
|
"github.com/smartystreets/goconvey/convey" |
|
"math/rand" |
|
"strconv" |
|
"testing" |
|
) |
|
|
|
func TestDaoMainVip(t *testing.T) { |
|
convey.Convey("MainVip", t, func(ctx convey.C) { |
|
var ( |
|
c = context.Background() |
|
mid = int64(27515308) |
|
) |
|
ctx.Convey("When everything gose positive", func(ctx convey.C) { |
|
mv, err := d.MainVip(c, mid) |
|
ctx.Convey("Then err should be nil.mv should not be nil.", func(ctx convey.C) { |
|
ctx.So(err, convey.ShouldBeNil) |
|
ctx.So(mv, convey.ShouldNotBeNil) |
|
}) |
|
}) |
|
}) |
|
} |
|
|
|
func TestDaoGiveMVipGift(t *testing.T) { |
|
convey.Convey("GiveMVipGift", t, func(ctx convey.C) { |
|
var ( |
|
c = context.Background() |
|
mid = int64(27515308) |
|
batchId = int(21) |
|
orderNo = "1" + strconv.Itoa(rand.Int()/100000) |
|
) |
|
ctx.Convey("When everything gose positive", func(ctx convey.C) { |
|
err := d.GiveMVipGift(c, mid, batchId, orderNo) |
|
ctx.Convey("Then err should be nil.", func(ctx convey.C) { |
|
ctx.So(err, convey.ShouldBeNil) |
|
}) |
|
}) |
|
}) |
|
}
|
|
|