34 lines
939 B
Go
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)
|
|
}
|
|
}
|