Przeglądaj źródła

add test function

Jerry 7 lat temu
rodzic
commit
61c4aef68c
1 zmienionych plików z 12 dodań i 0 usunięć
  1. 12 0
      wechat_client_test.go

+ 12 - 0
wechat_client_test.go

@@ -274,3 +274,15 @@ func TestMd5(t *testing.T) {
 	upper := strings.ToUpper(hex.EncodeToString(sum))
 	upper := strings.ToUpper(hex.EncodeToString(sum))
 	fmt.Println(" ssad  ", upper)
 	fmt.Println(" ssad  ", upper)
 }
 }
+
+func TestGetWeChatUserId(t *testing.T) {
+	userIdRsp, err := GetWeChatUserId(appID, secretKey, "")
+	if err != nil {
+		fmt.Println("err:", err)
+		return
+	}
+	fmt.Println("OpenID:", userIdRsp.Openid)
+	fmt.Println("UnionID:", userIdRsp.Unionid)
+	fmt.Println("SessionKey:", userIdRsp.SessionKey)
+
+}