mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 12:49:54 +05:00
Fixed unit test for ExtRateSIncrement
This commit is contained in:
committed by
Dan Christian Bogos
parent
6849529d2e
commit
1c75005643
@@ -20,7 +20,6 @@ package accounts
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"reflect"
|
||||
|
||||
@@ -1177,16 +1177,17 @@ func TestAccountMaxAbstracts(t *testing.T) {
|
||||
{
|
||||
IncrementStart: nil,
|
||||
IntervalRateIndex: 0,
|
||||
RateID: "",
|
||||
CompressFactor: 0,
|
||||
RateID: "id_for_Test",
|
||||
CompressFactor: 1,
|
||||
Usage: nil,
|
||||
},
|
||||
},
|
||||
CompressFactor: 1,
|
||||
}
|
||||
for _, val := range rpEv.Rating {
|
||||
if !reflect.DeepEqual(val, expRating) {
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expRating, val)
|
||||
val.Increments[0].RateID = "id_for_Test"
|
||||
if !reflect.DeepEqual(expRating, val) {
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", utils.ToJSON(expRating), utils.ToJSON(val))
|
||||
}
|
||||
}
|
||||
rpEv.Rating = map[string]*utils.ExtRateSInterval{}
|
||||
@@ -1381,16 +1382,17 @@ func TestAccountDebitAbstracts(t *testing.T) {
|
||||
{
|
||||
IncrementStart: nil,
|
||||
IntervalRateIndex: 0,
|
||||
RateID: "",
|
||||
CompressFactor: 0,
|
||||
RateID: "id_for_test",
|
||||
CompressFactor: 1,
|
||||
Usage: nil,
|
||||
},
|
||||
},
|
||||
CompressFactor: 1,
|
||||
}
|
||||
for _, val := range rpEv.Rating {
|
||||
val.Increments[0].RateID = "id_for_test"
|
||||
if !reflect.DeepEqual(val, expRating) {
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expRating, val)
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", utils.ToJSON(expRating), utils.ToJSON(val))
|
||||
}
|
||||
}
|
||||
rpEv.Rating = map[string]*utils.ExtRateSInterval{}
|
||||
@@ -1585,14 +1587,15 @@ func TestAccountActionSetBalance(t *testing.T) {
|
||||
{
|
||||
IncrementStart: nil,
|
||||
IntervalRateIndex: 0,
|
||||
RateID: "",
|
||||
CompressFactor: 0,
|
||||
RateID: "id_for_test",
|
||||
CompressFactor: 1,
|
||||
Usage: nil,
|
||||
},
|
||||
},
|
||||
CompressFactor: 1,
|
||||
}
|
||||
for _, val := range rpEv.Rating {
|
||||
val.Increments[0].RateID = "id_for_test"
|
||||
if !reflect.DeepEqual(val, expRating) {
|
||||
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expRating, val)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user