bilibili-backup/app/service/main/identify/dao/passport_test.go
2019-04-22 02:59:20 +00:00

37 lines
836 B
Go

package dao
import (
"context"
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestDaoAccessCookie(t *testing.T) {
var (
c = context.Background()
cookie = "cookie=cookie"
)
convey.Convey("AccessCookie", t, func(ctx convey.C) {
res, err := d.AccessCookie(c, cookie)
ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldNotBeNil)
ctx.So(res, convey.ShouldBeNil)
})
})
}
func TestDaoAccessToken(t *testing.T) {
var (
c = context.Background()
accesskey = "123456"
)
convey.Convey("AccessToken", t, func(ctx convey.C) {
res, err := d.AccessToken(c, accesskey)
ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldNotBeNil)
ctx.So(res, convey.ShouldBeNil)
})
})
}