fix_trial

This commit is contained in:
hangyu.tao 2026-01-16 19:04:44 +08:00
parent 8cbad66b32
commit c8f6341bc9

View File

@ -27,10 +27,10 @@ func TestUpdateTrialPeriodWithIsTrial(t *testing.T) {
endTime := now.Add(7 * 24 * time.Hour)
trialPeriod := models.TrialPeriod{
CustomerID: "test-customer-001",
StartTime: startTime,
EndTime: endTime,
IsTrial: true,
CustomerName: "test-customer-001",
StartTime: startTime,
EndTime: endTime,
IsTrial: true,
}
createdPeriod, err := storage.CreateTrialPeriod(trialPeriod)
@ -111,10 +111,10 @@ func TestUpdateTrialPeriodWithStartEndTime(t *testing.T) {
endTime := now.Add(7 * 24 * time.Hour)
trialPeriod := models.TrialPeriod{
CustomerID: "test-customer-002",
StartTime: startTime,
EndTime: endTime,
IsTrial: true,
CustomerName: "test-customer-002",
StartTime: startTime,
EndTime: endTime,
IsTrial: true,
}
createdPeriod, err := storage.CreateTrialPeriod(trialPeriod)
@ -190,10 +190,10 @@ func TestGetAllTrialPeriods(t *testing.T) {
now := time.Now()
for i := 0; i < 3; i++ {
trialPeriod := models.TrialPeriod{
CustomerID: "test-customer-bulk",
StartTime: now.Add(time.Duration(i) * 24 * time.Hour),
EndTime: now.Add(time.Duration(i+7) * 24 * time.Hour),
IsTrial: i%2 == 0, // Alternate true/false
CustomerName: "test-customer-bulk",
StartTime: now.Add(time.Duration(i) * 24 * time.Hour),
EndTime: now.Add(time.Duration(i+7) * 24 * time.Hour),
IsTrial: i%2 == 0, // Alternate true/false
}
_, err := storage.CreateTrialPeriod(trialPeriod)
if err != nil {
@ -235,10 +235,10 @@ func TestDeleteTrialPeriod(t *testing.T) {
// Create a trial period
now := time.Now()
trialPeriod := models.TrialPeriod{
CustomerID: "test-customer-delete",
StartTime: now,
EndTime: now.Add(7 * 24 * time.Hour),
IsTrial: true,
CustomerName: "test-customer-delete",
StartTime: now,
EndTime: now.Add(7 * 24 * time.Hour),
IsTrial: true,
}
createdPeriod, err := storage.CreateTrialPeriod(trialPeriod)