package weixinapi

import (
	"fmt"
	"testing"

	"git.rosy.net.cn/baseapi"

	"go.uber.org/zap"
)

var (
	api         *API
	sugarLogger *zap.SugaredLogger
)

func init() {
	logger, _ := zap.NewDevelopment()
	sugarLogger = logger.Sugar()
	baseapi.Init(sugarLogger)

	// sandbox
	// api = New("wxbf235770edaabc5c", "ba32b269a068a5b72486a0beafd171e8")

	// // prod
	api = New("wx2bb99eb5d2c9b82c", "6bbbed1443cc062c20a015a64c07a531")

	//weixinapp
	//api = New("wx18111a41fd17f24f", "c79ac6e1b2d6d7968e72a9658a8b6715")
	api.CBSetToken("46_sKrKhgoeh0Om1V2_IcTERUux4-pLL5CplvhOh7civG51UCSUTt6g3WkTutvk107i2SMhdcU5q9MYGbciZ4PHyPzhlzx34yBPblf8dpRHx3VYE_a9JbE2wbtjJY93GmXc4KcRHxlEa8s_QWFVOLCgADAKHY")
}

func handleError(t *testing.T, err error) {
	if err != nil {
		sugarLogger.Debug(err)
		t.Fatal(err.Error())
	}
}

func aa() {
	fmt.Println("hello")
}

func TestTest(t *testing.T) {
	go aa()
	fmt.Println("world")
}
