go-common/app/job/main/growup/dao/auto_test.go

78 lines
1.8 KiB
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
"context"
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestDaoDoAvBreach(t *testing.T) {
convey.Convey("DoAvBreach", t, func(ctx convey.C) {
var (
c = context.Background()
mid = int64(10)
aid = int64(100)
ctype = int(1)
reason = "test"
)
ctx.Convey("When everything goes positive", func(ctx convey.C) {
err := d.DoAvBreach(c, mid, aid, ctype, reason)
ctx.Convey("Then err should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldNotBeNil)
})
})
})
}
func TestDaoDoUpForbid(t *testing.T) {
convey.Convey("DoUpForbid", t, func(ctx convey.C) {
var (
c = context.Background()
mid = int64(10)
days = int(100)
ctype = int(1)
reason = "test"
)
ctx.Convey("When everything goes positive", func(ctx convey.C) {
err := d.DoUpForbid(c, mid, days, ctype, reason)
ctx.Convey("Then err should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldNotBeNil)
})
})
})
}
func TestDaoDoUpDismiss(t *testing.T) {
convey.Convey("DoUpDismiss", t, func(ctx convey.C) {
var (
c = context.Background()
mid = int64(100)
ctype = int(1)
reason = "test"
)
ctx.Convey("When everything goes positive", func(ctx convey.C) {
err := d.DoUpDismiss(c, mid, ctype, reason)
ctx.Convey("Then err should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldNotBeNil)
})
})
})
}
func TestDaoDoUpPass(t *testing.T) {
convey.Convey("DoUpPass", t, func(ctx convey.C) {
var (
c = context.Background()
mids = []int64{1, 2, 3}
ctype = int(1)
)
ctx.Convey("When everything goes positive", func(ctx convey.C) {
err := d.DoUpPass(c, mids, ctype)
ctx.Convey("Then err should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldNotBeNil)
})
})
})
}