mylomen-server/infrastructure/repository/user_base_repository_test.go

72 lines
1.3 KiB
Go
Raw Normal View History

2024-09-30 15:41:00 +08:00
package repository
import (
"context"
"testing"
)
func TestFindById(t *testing.T) {
data := GUser.FindById(context.Background(), 2)
if data.Id != uint64(2) {
t.Error("err")
}
}
func TestFindByAccount(t *testing.T) {
query := "syj"
data := GUser.FindByAccount(context.Background(), query)
if *data.Account != query {
t.Error("err")
}
}
func TestFindByPhone(t *testing.T) {
query := "19901639350"
data := GUser.FindByPhone(context.Background(), query)
if *data.Phone != query {
t.Error("err")
}
}
func TestFindByEmail(t *testing.T) {
query := "1290251929@qq.com"
data := GUser.FindByEmail(context.Background(), query)
if *data.Email != query {
t.Error("err")
}
}
func TestFindByWxId(t *testing.T) {
query := "unionsyj"
data := GUser.FindByWxId(context.Background(), query)
if *data.WxId != query {
t.Error("err")
}
}
func TestFindByQqId(t *testing.T) {
query := "1290251929"
data := GUser.FindByQqId(context.Background(), query)
if *data.QqId != query {
t.Error("err")
}
}
func TestFindByGoogleId(t *testing.T) {
query := "googleIdsyj"
data := GUser.FindByGoogleId(context.Background(), query)
if *data.GoogleId != query {
t.Error("err")
}
}
func TestFindByFacebookId(t *testing.T) {
query := "facebookIdSyj"
data := GUser.FindByFacebookId(context.Background(), query)
if *data.FacebookId != query {
t.Error("err")
}
}