ecs/platform/gravity/web_test.go
2025-06-04 18:17:39 +08:00

33 lines
759 B
Go

package gravity
import (
"github.com/oylshe1314/framework/util"
"testing"
)
func TestEventCollect(t *testing.T) {
var properties = Properties{}
properties.Add("lib", "api")
properties.Add("appId", 1)
properties.Add("pay_type", "CNY")
properties.Add("order_id", "PC1234567890")
properties.Add("charge_id", 1)
properties.Add("pay_amount", 600)
properties.Add("pay_reason", "月卡")
properties.Add("pay_method", "微信")
properties.Add("is_first_pay", false)
properties.Add("ip", "")
var err = eventCollect(tapTapAccessToken, "xsXBBmA3ZlyEGpu2RfSjMA==", "", &Event{
Type: EventTypeTrack,
Event: EventNameCharge,
Time: util.Unix(),
TimeFree: false,
Properties: properties,
})
if err != nil {
t.Error(err)
}
}