func TestNewRole(t *testing.T) { roleList, err := NewRole().FindAll() for _, tmpUser := range roleList { t.logger(tmpUser.Roleid) t.logger("===") } if err != nil { t.Fatal(err) } }
func testInsert(t *testing.T) { userLogin := NewUserLogin() userData := `{"uid":"1111","username":"******","email":"*****@*****.**","passwd":"123456"}` json.Unmarshal([]byte(userData), userLogin) // err := userLogin.Find() affectedNum, err := userLogin.Insert() if err != nil { t.Fatal(err) } t.logger(affectedNum) }
func TestNewUserLogin(t *testing.T) { user := NewUser() userList, err := user.FindAll() for _, tmpUser := range userList { t.logger(tmpUser.Name) t.logger("===") } if err == nil { t.Fatal(err) } }
func TestFindUsers(t *testing.T) { userList, err := FindUsers() if err != nil && len(userList) == 0 { t.Fatal(err) } t.logger(len(userList)) for k, tmpUser := range userList { t.logger(k, tmpUser) t.logger("===") } }