mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
more validations and tests
This commit is contained in:
@@ -160,6 +160,9 @@ func (rp *RatingPlan) areRatesSane() bool {
|
||||
if math.Mod(nextRate.GroupIntervalStart.Seconds(), rate.RateIncrement.Seconds()) != 0 {
|
||||
return false
|
||||
}
|
||||
if rate.RateUnit == 0 || rate.RateIncrement == 0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,10 +380,12 @@ func TestRatingPlanSaneRatingsGoot(t *testing.T) {
|
||||
&Rate{
|
||||
GroupIntervalStart: 60 * time.Second,
|
||||
RateIncrement: 30 * time.Second,
|
||||
RateUnit: 1 * time.Second,
|
||||
},
|
||||
&Rate{
|
||||
GroupIntervalStart: 0 * time.Second,
|
||||
RateIncrement: 30 * time.Second,
|
||||
RateUnit: 1 * time.Second,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user