Files
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

34 lines
939 B
Go

package rechargeser
import (
"testing"
"91porn-server/models/v/rchgordmod"
)
func TestBaiYuanCopiesOrderAttribution(t *testing.T) {
order := &rchgordmod.RechargeOrder{
SourcePage: "VIDEO_BOTTOM_SHEET",
SourceRef: "source-ref",
VideoID: "video-id",
ActivityID: "activity-id",
ExperimentID: "experiment-id",
ExperimentVariant: "A",
SessionID: "session-id",
}
records := BaiYuan([]*rchgordmod.RechargeOrder{order})
if len(records) != 1 {
t.Fatalf("len(records) = %d", len(records))
}
record := records[0]
if record.SourcePage != order.SourcePage ||
record.SourceRef != order.SourceRef ||
record.VideoID != order.VideoID ||
record.ActivityID != order.ActivityID ||
record.ExperimentID != order.ExperimentID ||
record.ExperimentVariant != order.ExperimentVariant ||
record.SessionID != order.SessionID {
t.Fatalf("attribution not copied: %#v", record)
}
}