bilibili-backup/app/service/main/vip/dao/privilege_test.go

37 lines
801 B
Go
Raw Normal View History

2019-04-22 10:59:20 +08:00
package dao
import (
"context"
"testing"
"github.com/smartystreets/goconvey/convey"
)
// go test -test.v -test.run TestDaoPrivilegeList
func TestDaoPrivilegeList(t *testing.T) {
var (
c = context.TODO()
)
convey.Convey("PrivilegeList", t, func(ctx convey.C) {
res, err := d.PrivilegeList(c)
ctx.Convey("Error should be nil", func(ctx convey.C) {
ctx.So(err, convey.ShouldBeNil)
})
ctx.Convey("res should not be nil", func(ctx convey.C) {
ctx.So(res, convey.ShouldNotBeNil)
})
})
}
func TestDaoPrivilegeResourcesList(t *testing.T) {
var (
c = context.TODO()
)
convey.Convey("PrivilegeResourcesList", t, func(ctx convey.C) {
_, err := d.PrivilegeResourcesList(c)
ctx.Convey("Error should be nil", func(ctx convey.C) {
ctx.So(err, convey.ShouldBeNil)
})
})
}