go-common/app/job/main/passport-user-compare/dao/duplicate_test.go
2019-04-22 18:49:16 +08:00

71 lines
1.9 KiB
Go

package dao
import (
"context"
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestDaoUserTelDuplicate(t *testing.T) {
convey.Convey("UserTelDuplicate", t, func(ctx convey.C) {
var (
c = context.Background()
)
ctx.Convey("When everything gose positive", func(ctx convey.C) {
res, err := d.UserTelDuplicate(c)
ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldBeNil)
ctx.So(res, convey.ShouldBeNil)
})
})
})
}
func TestDaoUserEmailDuplicate(t *testing.T) {
convey.Convey("UserEmailDuplicate", t, func(ctx convey.C) {
var (
c = context.Background()
)
ctx.Convey("When everything gose positive", func(ctx convey.C) {
res, err := d.UserEmailDuplicate(c)
ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldBeNil)
ctx.So(res, convey.ShouldBeNil)
})
})
})
}
func TestDaoUpdateUserTelDuplicateStatus(t *testing.T) {
convey.Convey("UpdateUserTelDuplicateStatus", t, func(ctx convey.C) {
var (
c = context.Background()
id = int64(0)
)
ctx.Convey("When everything gose positive", func(ctx convey.C) {
affected, err := d.UpdateUserTelDuplicateStatus(c, id)
ctx.Convey("Then err should be nil.affected should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldBeNil)
ctx.So(affected, convey.ShouldNotBeNil)
})
})
})
}
func TestDaoUpdateUserEmailDuplicateStatus(t *testing.T) {
convey.Convey("UpdateUserEmailDuplicateStatus", t, func(ctx convey.C) {
var (
c = context.Background()
id = int64(0)
)
ctx.Convey("When everything gose positive", func(ctx convey.C) {
affected, err := d.UpdateUserEmailDuplicateStatus(c, id)
ctx.Convey("Then err should be nil.affected should not be nil.", func(ctx convey.C) {
ctx.So(err, convey.ShouldBeNil)
ctx.So(affected, convey.ShouldNotBeNil)
})
})
})
}